Add --verbose to the completion def
This commit is contained in:
parent
1ef91ce5f2
commit
40b97e0c15
1 changed files with 17 additions and 12 deletions
|
@ -1,8 +1,5 @@
|
||||||
#compdef dots
|
#compdef dots
|
||||||
: ${DOTFILES:=~/dotfiles}
|
: ${DOTFILES:=~/dotfiles}
|
||||||
local context state state_descr line
|
|
||||||
typeset -A opt_args
|
|
||||||
|
|
||||||
local repo
|
local repo
|
||||||
local -a commands repos new_repos
|
local -a commands repos new_repos
|
||||||
commands=(
|
commands=(
|
||||||
|
@ -15,16 +12,19 @@ commands=(
|
||||||
pull:'fetch and apply package updates'
|
pull:'fetch and apply package updates'
|
||||||
status:'check whether your packages have changes'
|
status:'check whether your packages have changes'
|
||||||
)
|
)
|
||||||
|
|
||||||
if ! _retrieve_cache dots-repositories; then
|
if ! _retrieve_cache dots-repositories; then
|
||||||
repos=($(curl -s -X GET "https://git.00dani.me/api/v1/orgs/dot/repos" -H "accept: application/json" | jq -r '.[].name'))
|
repos=($(curl -s -X GET "https://git.00dani.me/api/v1/orgs/dot/repos" -H "accept: application/json" | jq -r '.[].name'))
|
||||||
_store_cache dots-repositories repos
|
_store_cache dots-repositories repos
|
||||||
fi
|
fi
|
||||||
|
for repo in $repos; [[ -d $DOTFILES/$repo ]] || new_repos+=$repo
|
||||||
|
|
||||||
for repo in $repos; [[ -d $DOTFILES/$repo ]] || new_repos+=($repo)
|
_dots_subcommands() {
|
||||||
_arguments '1:cmds:->cmds' '*:: :->args'
|
_describe -t commands command commands
|
||||||
case $state in
|
}
|
||||||
cmds) _describe -t commands command commands ;;
|
|
||||||
args) case $line[1] in
|
_dots_subcommand_parameters() {
|
||||||
|
case $words[1] in
|
||||||
bootstrap) _nothing ;; # no more arguments!
|
bootstrap) _nothing ;; # no more arguments!
|
||||||
clone)
|
clone)
|
||||||
if (( $#new_repos )); then
|
if (( $#new_repos )); then
|
||||||
|
@ -33,5 +33,10 @@ case $state in
|
||||||
_message 'all known packages are already installed, you can still enter a git url manually'
|
_message 'all known packages are already installed, you can still enter a git url manually'
|
||||||
fi ;;
|
fi ;;
|
||||||
fetch|*stow|pull|st|status) _values -w package $DOTFILES/*(/:t) ;;
|
fetch|*stow|pull|st|status) _values -w package $DOTFILES/*(/:t) ;;
|
||||||
esac ;;
|
|
||||||
esac
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
_arguments \
|
||||||
|
'(-v --verbose)'{-v,--verbose}'[request verbose output from Git and Stow]' \
|
||||||
|
': :_dots_subcommands' \
|
||||||
|
'*:: :_dots_subcommand_parameters'
|
||||||
|
|
Loading…
Reference in a new issue