aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-07-24 08:22:10 +0000
committermerakor <cem@ckyln.com>2020-07-24 08:22:10 +0000
commit8c5271501560c0cf491b5b8b34f67a00158591a1 (patch)
tree8ea579f2a850514ca8b45fde3a18396ee17b2603
parent8036e697a90db79836e1f44ce184b3f287e2a7e5 (diff)
downloadcpt-8c5271501560c0cf491b5b8b34f67a00158591a1.tar.gz
cpt: handle utilities in its own variable
FossilOrigin-Name: 2daea1035717ac46467b5c99f785c545bbba51c5bfdc3b69474a55c12b996672
-rwxr-xr-xcpt7
1 files changed, 4 insertions, 3 deletions
diff --git a/cpt b/cpt
index 990fb72..d29083d 100755
--- a/cpt
+++ b/cpt
@@ -3,7 +3,8 @@
if command -v cpt-lib >/dev/null; then . cpt-lib; else . ./lib.sh; fi
-case "$1" in
+[ "$1" ] && { arg=$1; shift; }
+case "$arg" in
--help|-h|'')
log "Carbs Packaging Tool"
set --
@@ -12,7 +13,7 @@ case "$1" in
max=$((${#1} > max ? ${#1} : max))
done
- for path in "$@"; do
+ for path; do
# These are binary files so they should be ignored
contains "readlink stat" "$path" && continue
@@ -27,7 +28,7 @@ case "$1" in
util=$(SEARCH_PATH=$PATH pkg_find "cpt-$1"* "" -x 2>/dev/null) ||
die "'cpt $action' is not a valid command"
- shift; "$util" "$@"
+ "$util" "$@"
;;
esac