aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorgrai <t.lainson@gmail.com>2008-07-22 03:26:34 +1000
committergrai <t.lainson@gmail.com>2008-07-22 03:26:34 +1000
commit2863f80be896bdbc5bf2507c81d5331cc96482b3 (patch)
tree5c57123de3de1e1d11b3f2fb846dc397907433a3 /bin
parent881e5d1e95367ad84cac49dbb958a361b1ec998e (diff)
downloadplan9port-2863f80be896bdbc5bf2507c81d5331cc96482b3.tar.gz
plan9port-2863f80be896bdbc5bf2507c81d5331cc96482b3.tar.bz2
plan9port-2863f80be896bdbc5bf2507c81d5331cc96482b3.zip
man: reject unrecognized flags
Diffstat (limited to 'bin')
-rwxr-xr-xbin/man6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/man b/bin/man
index 2ea92de4..bc51dae0 100755
--- a/bin/man
+++ b/bin/man
@@ -67,14 +67,15 @@ fn dohtml {
#
# parse flags and sections
#
+fn usage { echo 'Usage: man [-hnpPtw] [-s sec] [0-9] [0-9] ... [--] name1 name2 ...' >[1=2] }
cmd=donroff
sec=()
S=$PLAN9/man
d=0
while(~ $d 0) {
if(~ $#* 0) {
- echo 'Usage: man [-hnpPtw] [-s sec] [0-9] [0-9] ... [--] name1 name2 ...' >[1=2]
- exit
+ usage
+ exit 1
}
if(test -d $S/man$1){
sec=($sec $1)
@@ -88,6 +89,7 @@ while(~ $d 0) {
case -w ; cmd=doecho ; shift
case -h ; cmd=dohtml ; shift
case -- ; d=1 ; shift
+ case -* ; usage ; exit 1
case * ; d=1
}
}