Add help to iglu.sh
This commit is contained in:
parent
f714464e34
commit
18da6658d2
1 changed files with 34 additions and 4 deletions
38
iglu.sh
38
iglu.sh
|
@ -1,11 +1,34 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
HELP="
|
||||||
|
-h This help window
|
||||||
|
--help alias to \`-h\`
|
||||||
|
|
||||||
|
-i install
|
||||||
|
-u uninstall
|
||||||
|
-l outputs the license
|
||||||
|
-f lists installed files
|
||||||
|
-d list dependencies
|
||||||
|
-iu install update or install upgrade
|
||||||
|
-ui alias to \`-iu\`
|
||||||
|
|
||||||
|
NOT IMPLEMENTED:
|
||||||
|
-o root"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo $(basename "$0"): ERROR: "$@" 1>&2
|
echo usage: $(basename "$0") printf "${HELP}" 1>&2
|
||||||
echo usage: $(basename "$0") '([-i]|[-u]|[-f]|[-l]) [-o root]
|
|
||||||
[pkg.tar]' 1>&2
|
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
error_usage() {
|
||||||
|
echo $(basename "$0"): ERROR: "$@" 1>&2
|
||||||
|
usage
|
||||||
|
}
|
||||||
|
|
||||||
tar_fail() {
|
tar_fail() {
|
||||||
echo "Failed to extract tar"
|
echo "Failed to extract tar"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -45,6 +68,9 @@ dep_not_found() {
|
||||||
|
|
||||||
i= u= l= f= o= d= iu=
|
i= u= l= f= o= d= iu=
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Handle commandline arguments.
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-i) i=1;;
|
-i) i=1;;
|
||||||
-u) u=1;;
|
-u) u=1;;
|
||||||
|
@ -53,7 +79,11 @@ case "$1" in
|
||||||
-d) d=1;;
|
-d) d=1;;
|
||||||
-iu) iu=1;;
|
-iu) iu=1;;
|
||||||
-ui) iu=1;;
|
-ui) iu=1;;
|
||||||
*) usage "bad argument $i";;
|
|
||||||
|
-h) usage;;
|
||||||
|
--help) usage;;
|
||||||
|
|
||||||
|
*) error_usage "bad argument $i";;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue