aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcpt26
1 files changed, 18 insertions, 8 deletions
diff --git a/cpt b/cpt
index 63bab84..3add8b6 100755
--- a/cpt
+++ b/cpt
@@ -20,15 +20,25 @@ case "$arg" in
printf "%b->%b %-${max}s " "${color:+\033[1;31m}" "${color:+\033[m}" "${path#*/cpt-}"
sed -n 's/^# *//;2p' "$(command -v "cpt-$path")"
done | sort -uk1 >&2
+ exit
;;
- --version|-v) version ;;
-
- *)
- util=$(SEARCH_PATH=$PATH pkg_find "cpt-$arg"* "" -x 2>/dev/null) ||
- die "'cpt $arg' is not a valid command"
+ --version|-v|version) version ;;
+
+ # Reserve these arguments for the following tools.
+ a) arg=alternatives ;;
+ b) arg=build ;;
+ c) arg=checksum ;;
+ d) arg=download ;;
+ f) arg=fetch ;;
+ i) arg=install ;;
+ l) arg=list ;;
+ r) arg=remove ;;
+ s) arg=search ;;
+ u) arg=update ;;
+esac
- "$util" "$@"
- ;;
+util=$(SEARCH_PATH=$PATH pkg_find "cpt-$arg"* "" -x 2>/dev/null) ||
+ die "'cpt $arg' is not a valid command"
-esac
+"$util" "$@"