cpt

[ARCHIVED] Carbs Packaging Tools
git clone git://git.ckyln.com/~cem/cpt.git
Log | Files | Refs | README | LICENSE

commit 2bc342819f66cf86305ef8631653f74b735eb18a
parent 47337eacc4e1638fd5263581a98b2d2cc9dd0d83
Author: Cem Keylan <cem@ckyln.com>
Date:   Fri, 24 Jul 2020 17:46:57 +0300

cpt: don't apply globs when using main tools

Diffstat:
Msrc/cpt | 28++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/src/cpt b/src/cpt @@ -1,7 +1,10 @@ #!/bin/sh -ef # shellcheck disable=1091 -if command -v cpt-lib >/dev/null; then . cpt-lib; else ./cpt-lib; fi +if command -v cpt-lib >/dev/null; then . cpt-lib; else . ./cpt-lib; fi + +# If none of the tools below are specified, we will reenable glob +unset glob [ "$1" ] && { arg=$1; shift; } case "$arg" in @@ -26,19 +29,20 @@ case "$arg" in --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 ;; + a|alternatives) arg=alternatives ;; + b|build) arg=build ;; + c|checksum) arg=checksum ;; + d|download) arg=download ;; + f|fetch) arg=fetch ;; + i|install) arg=install ;; + l|list) arg=list ;; + r|remove) arg=remove ;; + s|search) arg=search ;; + u|update) arg=update ;; + *) glob=1 ;; esac -util=$(SEARCH_PATH=$PATH pkg_find "cpt-$arg"* "" -x 2>/dev/null) || +util=$(SEARCH_PATH=$PATH pkg_find "cpt-$arg${glob:+*}" "" -x 2>/dev/null) || die "'cpt $arg' is not a valid command" "$util" "$@"