fix synopses
This commit is contained in:
		
							parent
							
								
									16d642aff6
								
							
						
					
					
						commit
						3fb84937bd
					
				| @ -7,7 +7,7 @@ peek \(en read from standard input, furtively | ||||
| .SH SYNOPSIS | ||||
| 
 | ||||
| peek | ||||
| .RB ( -1eno ) | ||||
| .RB ( -1enot ) | ||||
| .RB ( -p | ||||
| .RB [ program | ||||
| .RB [ arguments... ]]) | ||||
|  | ||||
							
								
								
									
										11
									
								
								peek/peek.c
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								peek/peek.c
									
									
									
									
									
								
							| @ -47,9 +47,14 @@ int main(int argc, char *argv[]){ | ||||
| 		default:  goto usage; | ||||
| 		} | ||||
| 
 | ||||
| 	if((argc > optind && outputs[2] == 0) | ||||
| 			|| (!(argc > optind) && outputs[2] != 0)){ | ||||
| usage:		fprintf(stderr, "Usage: %s (-1eno)" | ||||
| 	/* If -p is used there must be additional arguments. This is to support
 | ||||
| 	 * arbitrary arguments to the command specified but has the side-effect | ||||
| 	 * of being inconsistent with other programs in that the usage | ||||
| 	 * 'peek -p1n cat' would work, where usually the 'cat' program would | ||||
| 	 * have to be specified immediately after -p as in 'peek -1np cat'. | ||||
| 	 * This is fine, though, because all intended usages work fine. */ | ||||
| 	if((argc > optind) == (outputs[2] == 0)){ | ||||
| usage:		fprintf(stderr, "Usage: %s (-1enot)" | ||||
| 			" (-p [program [arguments...]])\n", | ||||
| 			argv[0] == NULL ? program_name : argv[0]); | ||||
| 		return EX_USAGE; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user