aboutsummaryrefslogtreecommitdiff
path: root/kiss
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2020-02-03 09:02:04 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2020-02-03 09:02:04 +0000
commit69ca7e97739e81a40624092de9e980f3bde3a14c (patch)
treec6a7e3482d9e88944611514e65b01d10a5b285f6 /kiss
parentdbaedc1d2060764a004ef9d0263689833cf4a8c7 (diff)
downloadcpt-69ca7e97739e81a40624092de9e980f3bde3a14c.tar.gz
kiss: cleanup
FossilOrigin-Name: 47c95eefee1017b5752c7faa0434fbb5146463a79865551b20ae20f43ffb85f1
Diffstat (limited to 'kiss')
-rwxr-xr-xkiss33
1 files changed, 8 insertions, 25 deletions
diff --git a/kiss b/kiss
index 3b7e318..f776feb 100755
--- a/kiss
+++ b/kiss
@@ -1130,16 +1130,10 @@ args() {
#
# This handles the globbing characters '*', '!', '[' and ']' as per:
# https://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
- case $action in
- a|alternatives|s|search) ;;
-
- *)
- case $@ in
- *'*'*|*'!'*|*'['*|*']'*)
- die "Arguments contain invalid characters: '!*[]'"
- ;;
- esac
- esac
+ [ "${action#[as]*}" ] &&
+ case $@ in *'*'*|*'!'*|*'['*|*']'*)
+ die "Arguments contain invalid characters: '!*[]'"
+ esac
# Parse some arguments earlier to remove the need to duplicate code.
case $action in
@@ -1260,21 +1254,10 @@ args() {
done
;;
- l|list)
- pkg_list "$@"
- ;;
-
- u|update)
- pkg_updates
- ;;
-
- s|search)
- for pkg; do pkg_find "$pkg" all; done
- ;;
-
- v|version|-v|--version)
- log kiss 1.1.7
- ;;
+ l|list) pkg_list "$@" ;;
+ u|update) pkg_updates ;;
+ s|search) for pkg; do pkg_find "$pkg" all; done ;;
+ v|version) log kiss 1.1.7 ;;
h|help|-h|--help|'')
log 'kiss [a|b|c|i|l|r|s|u|v] [pkg] [pkg] [pkg]'