Skip to content
Snippets Groups Projects
Commit cca731a2 authored by Jason A. Donenfeld's avatar Jason A. Donenfeld
Browse files

Make completion cleaner.

parent 7df1e2de
No related branches found
No related tags found
No related merge requests found
...@@ -59,12 +59,13 @@ _pass() ...@@ -59,12 +59,13 @@ _pass()
local cur="${COMP_WORDS[COMP_CWORD]}" local cur="${COMP_WORDS[COMP_CWORD]}"
local commands="init ls show insert generate edit rm git help version" local commands="init ls show insert generate edit rm git help version"
if [[ $COMP_CWORD -gt 1 ]]; then if [[ $COMP_CWORD -gt 1 ]]; then
local lastarg="${COMP_WORDS[$COMP_CWORD-1]}"
case "${COMP_WORDS[1]}" in case "${COMP_WORDS[1]}" in
init) init)
COMPREPLY+=($(compgen -W "-e --reencrypt -p --path" -- ${cur})) if [[ $lastarg == "-p" || $lastarg == "--path" ]]; then
if [[ ${COMP_WORDS[$COMP_CWORD-1]} == "-p" || ${COMP_WORDS[$COMP_CWORD-1]} == "--path" ]]; then
_pass_complete_folders _pass_complete_folders
else else
COMPREPLY+=($(compgen -W "-e --reencrypt -p --path" -- ${cur}))
_pass_complete_keys _pass_complete_keys
fi fi
;; ;;
...@@ -88,7 +89,7 @@ _pass() ...@@ -88,7 +89,7 @@ _pass()
_pass_complete_entries _pass_complete_entries
;; ;;
git) git)
COMPREPLY+=($(compgen -W "init push pull config log reflog" -- ${cur})) COMPREPLY+=($(compgen -W "init push pull config log reflog rebase" -- ${cur}))
;; ;;
esac esac
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment