summaryrefslogtreecommitdiff
path: root/rc
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2020-03-10 10:09:34 -0700
committerOri Bernstein <ori@eigenstate.org>2020-03-10 10:09:34 -0700
commit5bc9b0c3cac34864d479c099283793ec4ae5565e (patch)
tree943d06d59dfd6c13cc0a724a3118d5099b264884 /rc
parent06ea44c895a5f97b7b9b65fce84dec2700f443fb (diff)
downloadplan9front-5bc9b0c3cac34864d479c099283793ec4ae5565e.tar.xz
improve usage messages (thanks henesy)
Fix inconsistencies between programs and their usage messages, correct instances where information seems to be missing or lost. This includes missing arguments, making usage consistent with manuals, and so on.
Diffstat (limited to 'rc')
-rwxr-xr-xrc/bin/approx2
-rwxr-xr-xrc/bin/doc2txt2
-rwxr-xr-xrc/bin/doctype5
-rwxr-xr-xrc/bin/juke2
-rwxr-xr-xrc/bin/lookman2
-rwxr-xr-xrc/bin/lp2
-rwxr-xr-xrc/bin/man4
-rwxr-xr-xrc/bin/psfax4
-rwxr-xr-xrc/bin/psu2
-rwxr-xr-xrc/bin/sig4
-rwxr-xr-xrc/bin/ssam3
-rwxr-xr-xrc/bin/tap2
12 files changed, 20 insertions, 14 deletions
diff --git a/rc/bin/approx b/rc/bin/approx
index b790da532..98dc89a5a 100755
--- a/rc/bin/approx
+++ b/rc/bin/approx
@@ -1,6 +1,6 @@
#!/bin/rc
if(! ~ $#* 3){
- echo usage: approx ratio min max
+ echo usage: approx ratio min max >[1=2]
exit usage
}
echo $1 $2 $3 | awk '
diff --git a/rc/bin/doc2txt b/rc/bin/doc2txt
index 65b68b48e..f01147ebc 100755
--- a/rc/bin/doc2txt
+++ b/rc/bin/doc2txt
@@ -3,7 +3,7 @@
rfork en
if(! ~ $#* 0 1) {
- echo 'Usage: doc2txt [file.doc]' >[1=2]
+ echo 'usage: doc2txt [file.doc]' >[1=2]
exit usage
}
diff --git a/rc/bin/doctype b/rc/bin/doctype
index 0f04f91ef..5aa6cc300 100755
--- a/rc/bin/doctype
+++ b/rc/bin/doctype
@@ -1,6 +1,11 @@
#!/bin/rc
# doctype: synthesize proper command line for troff
+if(~ $#* 0){
+ echo 'usage: doctype [ -n ] [ -T dev ] [ file ] ...' >[1=2]
+ exit usage
+}
+
troff=troff
eqn=eqn
prefer=prefer
diff --git a/rc/bin/juke b/rc/bin/juke
index a661c7f79..6a523d847 100755
--- a/rc/bin/juke
+++ b/rc/bin/juke
@@ -26,7 +26,7 @@ while(! ~ $#* 0) {
sname=$2
shift
case -*
- echo Usage: classical [-d level] [-t] [-h srvhost]
+ echo usage: juke [-d level] [-tw] [-s srv] [-h srvhost] >[1=2]
exit usage
}
shift
diff --git a/rc/bin/lookman b/rc/bin/lookman
index 5854e9528..e38d16695 100755
--- a/rc/bin/lookman
+++ b/rc/bin/lookman
@@ -16,7 +16,7 @@ fn sigint sighup sigterm {
*=`{echo $*|tr A-Z a-z|tr -dc 'a-z0-9_. \012'} # fold case, delete funny chars
if(~ $#* 0){
- echo Usage: lookman key ... >/fd/2
+ echo usage: lookman key ... >/fd/2
exit usage
}
look $1 $index | sed 's/.* //' | sort -u >$t1
diff --git a/rc/bin/lp b/rc/bin/lp
index a06848811..e7eba4e5e 100755
--- a/rc/bin/lp
+++ b/rc/bin/lp
@@ -93,7 +93,7 @@ flagfmt='D,H,L,Q,R,r,q,M mach,c copies,d printer,f font.size,i src,k jobnos,l li
argv0=lp
if(! ifs=() eval `{aux/getflags $*}) {
- echo $USAGE
+ echo $USAGE >[1=2]
exit usage
}
if(~ $flagd '?'){
diff --git a/rc/bin/man b/rc/bin/man
index 042fb1cca..f002c2121 100755
--- a/rc/bin/man
+++ b/rc/bin/man
@@ -59,8 +59,8 @@ fn page {
search=yes
while(~ $d 0) {
if(~ $#* 0) {
- echo 'Usage: man [-bntpPSw] [0-9] [0-9] ... name1 name2 ...' >[1=2]
- exit
+ echo 'usage: man [-bntpPSw] [0-9] [0-9] ... name1 name2 ...' >[1=2]
+ exit usage
}
if(test -d $S/$1){
sec=($sec $1)
diff --git a/rc/bin/psfax b/rc/bin/psfax
index 654f53bfe..d9d197b4a 100755
--- a/rc/bin/psfax
+++ b/rc/bin/psfax
@@ -10,8 +10,8 @@ case -v
switch($#*){
case 0 1
- echo usage: $0 telephone-number recipient '[files]'
- exit 0
+ echo usage: $0 telephone-number recipient '[files]' >[1=2]
+ exit usage
case 2
stdin=yes
}
diff --git a/rc/bin/psu b/rc/bin/psu
index d9f63fef8..0755a1817 100755
--- a/rc/bin/psu
+++ b/rc/bin/psu
@@ -15,6 +15,6 @@ case 0
case 1
ps $flags | sed -n '/^'$1' /p'
case *
- echo Usage: psu '[ps-flags] [ user ]' >[1=2]
+ echo usage: psu '[ps-flags] [ user ]' >[1=2]
exit usage
}
diff --git a/rc/bin/sig b/rc/bin/sig
index 56125ab17..918161641 100755
--- a/rc/bin/sig
+++ b/rc/bin/sig
@@ -5,8 +5,8 @@
*=`{echo $*|tr A-Z a-z|tr -dc 'a-z0-9_ \012'} # fold case, delete funny chars
if(~ $#* 0){
- echo Usage: sig function ... >/fd/2
- exit 1
+ echo usage: sig function ... >/fd/2
+ exit usage
}
for (i) {
diff --git a/rc/bin/ssam b/rc/bin/ssam
index dd931893d..a9e32b14e 100755
--- a/rc/bin/ssam
+++ b/rc/bin/ssam
@@ -4,7 +4,8 @@ rfork e
flagfmt='n,e script,f sfile'
args='[ file ... ]'
-fn usage { echo $0 '[ -n ] [ -e script ] [ -f sfile ] [ file ... ]' >[1=2] }
+argv0=$0
+fn usage { echo usage: $argv0 '[ -n ] [ -e script ] [ -f sfile ] [ file ... ]' >[1=2] }
if(! ifs=() eval `{aux/getflags $*}){
usage
exit usage
diff --git a/rc/bin/tap b/rc/bin/tap
index 0cc0d40af..ee40f0b95 100755
--- a/rc/bin/tap
+++ b/rc/bin/tap
@@ -2,7 +2,7 @@
rfork e
if(~ $#* 0){
- echo 'Usage: ' $0 '[ pid ... ]' >[1=2]
+ echo 'usage:' $0 '[ pid ... ]' >[1=2]
exit usage
}