1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-03-22 16:45:08 +00:00

adding "remove" option for #47 and fix a few issues/bugs

This commit is contained in:
deadc0de6
2019-06-02 18:18:52 +02:00
parent 44db88ce74
commit 4ed7b4d78c
13 changed files with 509 additions and 102 deletions

View File

@@ -38,6 +38,7 @@ _dotdrop ()
'import'
'compare'
'update'
'remove'
'listfiles'
'detail'
'list'
@@ -59,6 +60,9 @@ _dotdrop ()
update)
_dotdrop-update
;;
remove)
_dotdrop-remove
;;
listfiles)
_dotdrop-listfiles
;;
@@ -97,7 +101,7 @@ _dotdrop-install ()
'(-D)-D' \
'(--showdiff)--showdiff' \
'(-a)-a' \
'(--force-action)--force-action' \
'(--force-actions)--force-actions' \
'(-c=-)-c=-' \
'(--cfg=-)--cfg=-' \
'(-p=-)-p=-' \
@@ -193,6 +197,35 @@ _dotdrop-update ()
fi
}
_dotdrop-remove ()
{
local context state state_descr line
typeset -A opt_args
if [[ $words[$CURRENT] == -* ]] ; then
_arguments -C \
':command:->command' \
'(-V)-V' \
'(--verbose)--verbose' \
'(-b)-b' \
'(--no-banner)--no-banner' \
'(-f)-f' \
'(--force)--force' \
'(-d)-d' \
'(--dry)--dry' \
'(-k)-k' \
'(--key)--key' \
'(-c=-)-c=-' \
'(--cfg=-)--cfg=-' \
'(-p=-)-p=-' \
'(--profile=-)--profile=-' \
else
myargs=('<path>')
_message_next_arg
fi
}
_dotdrop-listfiles ()
{
local context state state_descr line

View File

@@ -38,6 +38,7 @@ _dotdrop.sh ()
'import'
'compare'
'update'
'remove'
'listfiles'
'detail'
'list'
@@ -59,6 +60,9 @@ _dotdrop.sh ()
update)
_dotdrop.sh-update
;;
remove)
_dotdrop.sh-remove
;;
listfiles)
_dotdrop.sh-listfiles
;;
@@ -97,7 +101,7 @@ _dotdrop.sh-install ()
'(-D)-D' \
'(--showdiff)--showdiff' \
'(-a)-a' \
'(--force-action)--force-action' \
'(--force-actions)--force-actions' \
'(-c=-)-c=-' \
'(--cfg=-)--cfg=-' \
'(-p=-)-p=-' \
@@ -193,6 +197,35 @@ _dotdrop.sh-update ()
fi
}
_dotdrop.sh-remove ()
{
local context state state_descr line
typeset -A opt_args
if [[ $words[$CURRENT] == -* ]] ; then
_arguments -C \
':command:->command' \
'(-V)-V' \
'(--verbose)--verbose' \
'(-b)-b' \
'(--no-banner)--no-banner' \
'(-f)-f' \
'(--force)--force' \
'(-d)-d' \
'(--dry)--dry' \
'(-k)-k' \
'(--key)--key' \
'(-c=-)-c=-' \
'(--cfg=-)--cfg=-' \
'(-p=-)-p=-' \
'(--profile=-)--profile=-' \
else
myargs=('<path>')
_message_next_arg
fi
}
_dotdrop.sh-listfiles ()
{
local context state state_descr line

View File

@@ -5,7 +5,7 @@ _dotdrop()
cur="${COMP_WORDS[COMP_CWORD]}"
if [ $COMP_CWORD -eq 1 ]; then
COMPREPLY=( $( compgen -W '-h --help -v --version install import compare update listfiles detail list' -- $cur) )
COMPREPLY=( $( compgen -W '-h --help -v --version install import compare update remove listfiles detail list' -- $cur) )
else
case ${COMP_WORDS[1]} in
install)
@@ -19,6 +19,9 @@ _dotdrop()
;;
update)
_dotdrop_update
;;
remove)
_dotdrop_remove
;;
listfiles)
_dotdrop_listfiles
@@ -40,7 +43,7 @@ _dotdrop_install()
cur="${COMP_WORDS[COMP_CWORD]}"
if [ $COMP_CWORD -ge 2 ]; then
COMPREPLY=( $( compgen -fW '-V --verbose -b --no-banner -t --temp -f --force -n --nodiff -d --dry -D --showdiff -a --force-action -c= --cfg= -p= --profile= ' -- $cur) )
COMPREPLY=( $( compgen -fW '-V --verbose -b --no-banner -t --temp -f --force -n --nodiff -d --dry -D --showdiff -a --force-actions -c= --cfg= -p= --profile= ' -- $cur) )
fi
}
@@ -74,6 +77,16 @@ _dotdrop_update()
fi
}
_dotdrop_remove()
{
local cur
cur="${COMP_WORDS[COMP_CWORD]}"
if [ $COMP_CWORD -ge 2 ]; then
COMPREPLY=( $( compgen -fW '-V --verbose -b --no-banner -f --force -d --dry -k --key -c= --cfg= -p= --profile= ' -- $cur) )
fi
}
_dotdrop_listfiles()
{
local cur

View File

@@ -5,7 +5,7 @@ _dotdropsh()
cur="${COMP_WORDS[COMP_CWORD]}"
if [ $COMP_CWORD -eq 1 ]; then
COMPREPLY=( $( compgen -W '-h --help -v --version install import compare update listfiles detail list' -- $cur) )
COMPREPLY=( $( compgen -W '-h --help -v --version install import compare update remove listfiles detail list' -- $cur) )
else
case ${COMP_WORDS[1]} in
install)
@@ -19,6 +19,9 @@ _dotdropsh()
;;
update)
_dotdropsh_update
;;
remove)
_dotdropsh_remove
;;
listfiles)
_dotdropsh_listfiles
@@ -40,7 +43,7 @@ _dotdropsh_install()
cur="${COMP_WORDS[COMP_CWORD]}"
if [ $COMP_CWORD -ge 2 ]; then
COMPREPLY=( $( compgen -fW '-V --verbose -b --no-banner -t --temp -f --force -n --nodiff -d --dry -D --showdiff -a --force-action -c= --cfg= -p= --profile= ' -- $cur) )
COMPREPLY=( $( compgen -fW '-V --verbose -b --no-banner -t --temp -f --force -n --nodiff -d --dry -D --showdiff -a --force-actions -c= --cfg= -p= --profile= ' -- $cur) )
fi
}
@@ -74,6 +77,16 @@ _dotdropsh_update()
fi
}
_dotdropsh_remove()
{
local cur
cur="${COMP_WORDS[COMP_CWORD]}"
if [ $COMP_CWORD -ge 2 ]; then
COMPREPLY=( $( compgen -fW '-V --verbose -b --no-banner -f --force -d --dry -k --key -c= --cfg= -p= --profile= ' -- $cur) )
fi
}
_dotdropsh_listfiles()
{
local cur