/rc/bin: amend usage misdirections (thanks umbraticus)
This commit is contained in:
parent
6ca8e6bbaf
commit
3cf83fa259
6 changed files with 10 additions and 10 deletions
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/rc
|
#!/bin/rc
|
||||||
rfork e
|
rfork e
|
||||||
if(! ~ $#* 1){
|
if(! ~ $#* 1){
|
||||||
echo usage: $0 fn >[2=1]
|
echo usage: $0 fn >[1=2]
|
||||||
exit usage
|
exit usage
|
||||||
}
|
}
|
||||||
if(~ $#srcpath 0) srcpath=.
|
if(~ $#srcpath 0) srcpath=.
|
||||||
|
@ -12,7 +12,7 @@ for(i in $res)
|
||||||
echo $i
|
echo $i
|
||||||
switch($#res){
|
switch($#res){
|
||||||
case 0
|
case 0
|
||||||
echo $1: not found >[2=1]
|
echo $1: not found >[1=2]
|
||||||
case 1
|
case 1
|
||||||
B $res
|
B $res
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ while(! ~ $#* 0){
|
||||||
case -q
|
case -q
|
||||||
opts=($opts -s)
|
opts=($opts -s)
|
||||||
case -*
|
case -*
|
||||||
echo $argv0 $1 not supported >[2=1]
|
echo $argv0 $1 not supported >[1=2]
|
||||||
exit 'not supported'
|
exit 'not supported'
|
||||||
case *
|
case *
|
||||||
files=($files $1)
|
files=($files $1)
|
||||||
|
|
|
@ -9,14 +9,14 @@ while(! ~ $#* 0 && ~ $1 -*){
|
||||||
case -s
|
case -s
|
||||||
;
|
;
|
||||||
case *
|
case *
|
||||||
echo 'usage: ln [-s] [-f] source destination' >[2=1]
|
echo 'usage: ln [-s] [-f] source destination' >[1=2]
|
||||||
exit 'usage'
|
exit 'usage'
|
||||||
}
|
}
|
||||||
shift
|
shift
|
||||||
}
|
}
|
||||||
|
|
||||||
if(~ $force n && test -e $2){
|
if(~ $force n && test -e $2){
|
||||||
echo ln: $2 destination exists >[2=1]
|
echo ln: $2 destination exists >[1=2]
|
||||||
exit 'usage'
|
exit 'usage'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ while(~ $1 -*){
|
||||||
case -l
|
case -l
|
||||||
load = yes
|
load = yes
|
||||||
case *
|
case *
|
||||||
echo >[2=1] 'usage: ipso [-a -f -e -l] [-s] [file ...]'
|
echo >[1=2] 'usage: ipso [-a -f -e -l] [-s] [file ...]'
|
||||||
exit usage
|
exit usage
|
||||||
}
|
}
|
||||||
shift
|
shift
|
||||||
|
@ -85,7 +85,7 @@ if(~ $flush yes && ~ $edit no && ~ $load no){
|
||||||
}
|
}
|
||||||
|
|
||||||
if(~ $get aesget && ~ $#* 0){
|
if(~ $get aesget && ~ $#* 0){
|
||||||
echo >[2=1] ipso: must specify a fully qualified file name for aescbc '(-a)'
|
echo >[1=2] ipso: must specify a fully qualified file name for aescbc '(-a)'
|
||||||
exit usage
|
exit usage
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ if(! test -d /n/sources/patch){
|
||||||
|
|
||||||
pref=''
|
pref=''
|
||||||
builtin cd /n/sources/patch || {
|
builtin cd /n/sources/patch || {
|
||||||
echo 'can''t cd /n/sources/patch' >[2=1]
|
echo 'can''t cd /n/sources/patch' >[1=2]
|
||||||
exit no-sources
|
exit no-sources
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ for(i in $*){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if not
|
if not
|
||||||
echo ' 'bad patch: $status >[2=1]
|
echo ' 'bad patch: $status >[1=2]
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
} >/tmp/patchtmp.$pid
|
} >/tmp/patchtmp.$pid
|
||||||
|
|
|
@ -29,7 +29,7 @@ fn xxx {
|
||||||
cp $2.backup $1
|
cp $2.backup $1
|
||||||
}
|
}
|
||||||
if not
|
if not
|
||||||
echo $1 has changed since patch was applied! >[2=1]
|
echo $1 has changed since patch was applied! >[1=2]
|
||||||
}
|
}
|
||||||
cat files | sed 's/^/xxx /' |rc
|
cat files | sed 's/^/xxx /' |rc
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue