summaryrefslogtreecommitdiffstats
path: root/ship/lib
diff options
context:
space:
mode:
Diffstat (limited to 'ship/lib')
-rw-r--r--ship/lib/punani12
1 files changed, 9 insertions, 3 deletions
diff --git a/ship/lib/punani b/ship/lib/punani
index 2c48f883..ab9d92a5 100644
--- a/ship/lib/punani
+++ b/ship/lib/punani
@@ -20,14 +20,20 @@ _punani_brew_install(){ brew install "$@"; }
_punani_brew_remove(){ brew remove "$@";}
_punani_brew_has(){ error "not implemented"; return 1 ;}
+_punani_usage='punani {install,remove,has} PACKAGE...'
punani(){
for p in ${KNOWN_PACKERS:-null}; do
exists $p && info "using $p" && PACKER=`echo $p | tr -d -` && break
done || die 'Error 2: no package manager found; no punani for you!'
ACTION="$1"; shift
+
+ if test $# = 0; then
+ error 'no PACKAGE specified.'
+ die "usage: $_punani_usage"
+ fi
+
PKGS="$*"
- [ -z "$PKGS" ] && error "no PACKAGE specified." && ACTION="usage"
for PKG in $PKGS; do
RES="`_punani_resolve_package $PKG`"
@@ -51,8 +57,8 @@ punani(){
fi
;;
*)
- error "usage: punani (install|remove|has) PACKAGE..."
- return 23
+ error "bad action: $ACTION"
+ die "usage: $_punani_usage"
esac
done
}