kiss: CRUX style usage fixes

This commit is contained in:
Dylan Araps 2020-05-18 11:44:24 +03:00
parent d224ccad0a
commit f41a014104
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 8 additions and 7 deletions

15
kiss
View File

@ -1479,6 +1479,14 @@ args() {
die "Arguments contain invalid characters: '!*[]' ($*)"
esac
# CRUX style usage using the current directory as the name of the package
# to be operated on. This needs to sit before the 'as_root()' calls as
# they reset the current working directory during their invocations.
[ "$1" ] || case $action in b|build|c|checksum|i|install|r|remove)
export KISS_PATH=${PWD%/*}:$KISS_PATH
set -- "${PWD##*/}"
esac
# Parse some arguments earlier to remove the need to duplicate code.
case $action in
s|search)
@ -1504,13 +1512,6 @@ args() {
;;
esac
# Second early check to use $PWD in place of arguments.
[ "$1" ] || case $action in b|build|c|checksum|i|install|r|remove)
export KISS_PATH=${PWD%/*}:$KISS_PATH
args "$action" "${PWD##*/}"
return 0
esac
# Actions can be abbreviated to their first letter. This saves
# keystrokes once you memorize the commands.
case $action in