fix: handle all CLI arguments
This commit is contained in:
parent
db3dac2c1e
commit
5a57f0542a
1 changed files with 6 additions and 4 deletions
10
instalee
10
instalee
|
@ -104,8 +104,8 @@ installpkg() {
|
||||||
## EXECUTION
|
## EXECUTION
|
||||||
|
|
||||||
version=$(printf "$name r%s.%s%s" "$(git rev-list --count HEAD 2>/dev/null)" "$(git rev-parse --short HEAD 2>/dev/null)" "$(git diff-index HEAD | wc -l | sed 's|^[1-9]|-mod\0|')")
|
version=$(printf "$name r%s.%s%s" "$(git rev-list --count HEAD 2>/dev/null)" "$(git rev-parse --short HEAD 2>/dev/null)" "$(git diff-index HEAD | wc -l | sed 's|^[1-9]|-mod\0|')")
|
||||||
# TODO getopt
|
while true
|
||||||
case "$1" in
|
do case "$1" in
|
||||||
(-V|--version|"")
|
(-V|--version|"")
|
||||||
printf "$version\nTry '$0 --help' or 'man $name' for usage info\n" >&2
|
printf "$version\nTry '$0 --help' or 'man $name' for usage info\n" >&2
|
||||||
# TODO license https://www.gnu.org/prep/standards/html_node/_002d_002dversion.html#g_t_002d_002dversion
|
# TODO license https://www.gnu.org/prep/standards/html_node/_002d_002dversion.html#g_t_002d_002dversion
|
||||||
|
@ -122,8 +122,8 @@ case "$1" in
|
||||||
action=$1
|
action=$1
|
||||||
shift
|
shift
|
||||||
case "$action" in
|
case "$action" in
|
||||||
(*=group) ${EDITOR:-vi} "$dir_home/groups/$1"; exit $?;;
|
(*group) ${EDITOR:-vi} "$dir_home/groups/$1"; exit $?;;
|
||||||
(*=handler)
|
(*handler)
|
||||||
file="$dir_home/handlers/$1/install"
|
file="$dir_home/handlers/$1/install"
|
||||||
if ! test -f "$file"; then
|
if ! test -f "$file"; then
|
||||||
mkdir -p "$(dirname "$file")"
|
mkdir -p "$(dirname "$file")"
|
||||||
|
@ -155,7 +155,9 @@ case "$1" in
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
(*) break;;
|
||||||
esac
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
installdefault() {
|
installdefault() {
|
||||||
local defaulthandler="$(head -1 "$handlersfile")"
|
local defaulthandler="$(head -1 "$handlersfile")"
|
||||||
|
|
Loading…
Add table
Reference in a new issue