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

Add rudimentry bash-completion script. Needs work.

parent 5f12b644
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
_pass()
{
local cur prev prefix suffix gen
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
prefix="$HOME/.password-store/"
suffix=".gpg"
if [[ $prev == --* ]]; then
return 0
fi
for item in $(compgen -f $prefix$cur); do
if [[ $item == $prefix.* ]]; then
continue
fi
if [[ -d $item ]]; then
item="$item/"
fi
item="${item%$suffix}"
gen="$gen ${item#$prefix}"
done
COMPREPLY=( $gen )
}
complete -o filenames -o nospace -F _pass pass
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