From 6b833795edb8db83b2a786cf3c8209ec95d4b87d Mon Sep 17 00:00:00 2001 From: merakor Date: Tue, 14 Apr 2020 18:04:07 +0000 Subject: kiss: use the current working directory for packages if no argument is specified These affect: * build * checksum * install * remove FossilOrigin-Name: 930ed3227beb3e2ae5db1c9b9cae6fd090a2565df5d9e3206e6861ad432bca99 --- kiss | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/kiss b/kiss index b3af1cb..9053c2c 100755 --- a/kiss +++ b/kiss @@ -1238,7 +1238,7 @@ args() { # Parse some arguments earlier to remove the need to duplicate code. case $action in - c|checksum|s|search) + s|search) [ "$1" ] || die "'kiss $action' requires an argument" ;; @@ -1252,8 +1252,6 @@ args() { ;; i|install|r|remove) - [ "$1" ] || die "'kiss $action' requires an argument" - # Rerun the script with 'su' if the user isn't root. # Cheeky but 'su' can't be used on shell functions themselves. [ "$uid" = 0 ] || { @@ -1263,6 +1261,10 @@ args() { ;; esac + case $action in + b|build|c|checksum|i|install|r|remove) + [ "$1" ] || set -- "${PWD##*/}" ; esac + # Actions can be abbreviated to their first letter. This saves # keystrokes once you memorize the commands. case $action in @@ -1285,9 +1287,6 @@ args() { ;; b|build) - # If no arguments were passed, rebuild all packages. - [ "$1" ] || { cd "$sys_db" && { set +f; set -f -- *; } } - pkg_build "${@:?No packages installed}" ;; -- cgit v1.2.3