use : instead of true...

Change file file to file1 file2, partly for igor, and partly because
it's odd to pass the same file to a command twice..
This commit is contained in:
jmg 2015-08-01 17:27:47 +00:00
parent 13db4664b3
commit fe67f23dc9

View File

@ -1,6 +1,6 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" .\"
.Dd January 26, 2011 .Dd August 1, 2015
.Dt GETOPT 1 .Dt GETOPT 1
.Os .Os
.Sh NAME .Sh NAME
@ -62,7 +62,7 @@ set \-\- $args
# You cannot use the set command with a backquoted getopt directly, # You cannot use the set command with a backquoted getopt directly,
# since the exit code from getopt would be shadowed by those of set, # since the exit code from getopt would be shadowed by those of set,
# which is zero by definition. # which is zero by definition.
while true; do while :; do
case "$1" in case "$1" in
\-a|\-b) \-a|\-b)
echo "flag $1 set"; sflags="${1#-}$sflags" echo "flag $1 set"; sflags="${1#-}$sflags"
@ -83,10 +83,10 @@ echo "oarg is '$oarg'"
.Pp .Pp
This code will accept any of the following as equivalent: This code will accept any of the following as equivalent:
.Bd -literal -offset indent .Bd -literal -offset indent
cmd \-aoarg file file cmd \-aoarg file1 file2
cmd \-a \-o arg file file cmd \-a \-o arg file1 file2
cmd \-oarg -a file file cmd \-oarg -a file1 file2
cmd \-a \-oarg \-\- file file cmd \-a \-oarg \-\- file1 file2
.Ed .Ed
.Sh SEE ALSO .Sh SEE ALSO
.Xr getopts 1 , .Xr getopts 1 ,