summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJeffrey Ratcliffe <Jeffrey.Ratcliffe@gmail.com>2012-09-22 09:57:08 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2012-09-22 13:14:21 +0200
commite1c0022255508dcb1ec3dd6dd25e1288d927d384 (patch)
tree451ef927541e91e6379435173db565110decf9bc /contrib
parentc2d28accf5c79c7929a90506061c70ffa70cca86 (diff)
downloadpass-e1c0022255508dcb1ec3dd6dd25e1288d927d384.tar.gz
pass-e1c0022255508dcb1ec3dd6dd25e1288d927d384.tar.bz2
pass-e1c0022255508dcb1ec3dd6dd25e1288d927d384.zip
bash completion - Fix UTF8, escape spaces, inverted commas, brackets, and ampersands, and clean up
Diffstat (limited to 'contrib')
-rw-r--r--contrib/pass.bash-completion24
1 files changed, 10 insertions, 14 deletions
diff --git a/contrib/pass.bash-completion b/contrib/pass.bash-completion
index 36c0cf2..71bb12a 100644
--- a/contrib/pass.bash-completion
+++ b/contrib/pass.bash-completion
@@ -10,7 +10,6 @@ _pass_complete_entries () {
autoexpand=${1:-0}
local IFS=$'\n'
- local i=0
for item in $(compgen -f $prefix$cur); do
if [[ $item == $prefix.* ]]; then
continue
@@ -30,28 +29,28 @@ _pass_complete_entries () {
fi
done
item="${item%$suffix}"
- COMPREPLY[$i]=$(printf "%q" "${item#$prefix}" )
- (( i++ ))
+ item="${item// /\ }"
+ item="${item//'/\'}"
+ item="${item//\(/\(}"
+ item="${item//)/\)}"
+ item="${item//&/\&}"
+ COMPREPLY+=("${item#$prefix}")
done
}
_pass()
{
- local cur prev opts base
-
COMPREPLY=()
- cur="${COMP_WORDS[COMP_CWORD]}"
- prev="${COMP_WORDS[COMP_CWORD-1]}"
-
- commands="init ls show insert generate edit rm git help --help version --version"
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ local commands="init ls show insert generate edit rm git help --help version --version"
if [[ $COMP_CWORD -gt 1 ]]; then
case "${COMP_WORDS[1]}" in
init)
COMPREPLY+=($(compgen -W "-e --reencrypt" -- ${cur}))
- keys=$(gpg --list-keys |grep uid |sed 's/.*<\(.*\)>/\1/')
+ local keys=$(gpg --list-keys |grep uid |sed 's/.*<\(.*\)>/\1/')
COMPREPLY+=($(compgen -W "${keys}" -- ${cur}))
;;
- ls|list)
+ ls|list|edit)
_pass_complete_entries
;;
show|-*)
@@ -66,9 +65,6 @@ _pass()
COMPREPLY+=($(compgen -W "-n --no-symbols -c --clip -f --force" -- ${cur}))
_pass_complete_entries
;;
- edit)
- _pass_complete_entries
- ;;
rm|remove|delete)
COMPREPLY+=($(compgen -W "-r --recursive -f --force" -- ${cur}))
_pass_complete_entries
td>-28/+25 2020-04-20Fix vettingRené 'Necoro' Neumann1-1/+1 2020-04-20Started with mail creationRené 'Necoro' Neumann4-3/+126 2020-04-20FeeditemsRené 'Necoro' Neumann2-2/+14 2020-04-20GlobalOptionsRené 'Necoro' Neumann3-25/+79 2020-04-19RestructureRené 'Necoro' Neumann6-152/+177 2020-04-19Rename package 'parse' to 'feed'René 'Necoro' Neumann2-3/+3 2020-04-19SELECT is not necessary for most operations -- skip itRené 'Necoro' Neumann2-12/+1 2020-04-19Store path as array -- the delimiter is not always '.'René 'Necoro' Neumann3-36/+44 2020-04-19Split client part to client.goRené 'Necoro' Neumann2-125/+137 2020-04-19IMAP: Create foldersRené 'Necoro' Neumann1-4/+38 2020-04-19Improved IMAPRené 'Necoro' Neumann1-3/+88 2020-04-19Started IMAP connectionRené 'Necoro' Neumann4-0/+152 2020-04-19Use our own logger for debug for convenience sakeRené 'Necoro' Neumann1-2/+3 2020-04-19Fix debug logging m(René 'Necoro' Neumann1-2/+2 2020-04-19Rename util.go to log.go. Add verbose modeRené 'Necoro' Neumann4-24/+54 2020-04-19Clean go.modRené 'Necoro' Neumann2-3/+0 2020-04-19Do not print the parsedCfg anymoreRené 'Necoro' Neumann1-1/+1 2020-04-19Increase go-version to 1.14René 'Necoro' Neumann1-2/+2 2020-04-19CI: go vetRené 'Necoro' Neumann1-0/+3 2020-04-19Fetching and parsing the feedsRené 'Necoro' Neumann5-4/+113 2020-04-19Ignore all config*.ymlRené 'Necoro' Neumann1-1/+1