fix synopses
This commit is contained in:
parent
16d642aff6
commit
3fb84937bd
@ -7,7 +7,7 @@ peek \(en read from standard input, furtively
|
|||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
|
||||||
peek
|
peek
|
||||||
.RB ( -1eno )
|
.RB ( -1enot )
|
||||||
.RB ( -p
|
.RB ( -p
|
||||||
.RB [ program
|
.RB [ program
|
||||||
.RB [ arguments... ]])
|
.RB [ arguments... ]])
|
||||||
|
11
peek/peek.c
11
peek/peek.c
@ -47,9 +47,14 @@ int main(int argc, char *argv[]){
|
|||||||
default: goto usage;
|
default: goto usage;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((argc > optind && outputs[2] == 0)
|
/* If -p is used there must be additional arguments. This is to support
|
||||||
|| (!(argc > optind) && outputs[2] != 0)){
|
* arbitrary arguments to the command specified but has the side-effect
|
||||||
usage: fprintf(stderr, "Usage: %s (-1eno)"
|
* 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",
|
" (-p [program [arguments...]])\n",
|
||||||
argv[0] == NULL ? program_name : argv[0]);
|
argv[0] == NULL ? program_name : argv[0]);
|
||||||
return EX_USAGE;
|
return EX_USAGE;
|
||||||
|
Loading…
Reference in New Issue
Block a user