diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-04-06 20:38:31 -0400 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-04-06 20:38:31 -0400 |
commit | cca731a2954036425e35d6f1601a7debb71c1c49 (patch) | |
tree | 39aae7290fc814da0f17bab74695ff6c612c111e /src/completion | |
parent | 7df1e2de504f28574230ee214550aefa717f8476 (diff) |
Make completion cleaner.
Diffstat (limited to 'src/completion')
-rw-r--r-- | src/completion/pass.bash-completion | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/completion/pass.bash-completion b/src/completion/pass.bash-completion index c6a2f4b..d80b186 100644 --- a/src/completion/pass.bash-completion +++ b/src/completion/pass.bash-completion @@ -59,12 +59,13 @@ _pass() local cur="${COMP_WORDS[COMP_CWORD]}" local commands="init ls show insert generate edit rm git help version" if [[ $COMP_CWORD -gt 1 ]]; then + local lastarg="${COMP_WORDS[$COMP_CWORD-1]}" case "${COMP_WORDS[1]}" in init) - COMPREPLY+=($(compgen -W "-e --reencrypt -p --path" -- ${cur})) - if [[ ${COMP_WORDS[$COMP_CWORD-1]} == "-p" || ${COMP_WORDS[$COMP_CWORD-1]} == "--path" ]]; then + if [[ $lastarg == "-p" || $lastarg == "--path" ]]; then _pass_complete_folders else + COMPREPLY+=($(compgen -W "-e --reencrypt -p --path" -- ${cur})) _pass_complete_keys fi ;; @@ -88,7 +89,7 @@ _pass() _pass_complete_entries ;; git) - COMPREPLY+=($(compgen -W "init push pull config log reflog" -- ${cur})) + COMPREPLY+=($(compgen -W "init push pull config log reflog rebase" -- ${cur})) ;; esac else |