Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
libre
keyringer-macosx
Commits
be12c6d6
Commit
be12c6d6
authored
Aug 23, 2014
by
Silvio Rhatto
Browse files
Adding completions for cp and mv actions
parent
fdcf1c06
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
lib/keyringer/completions/bash/keyringer
lib/keyringer/completions/bash/keyringer
+5
-1
lib/keyringer/completions/zsh/_keyringer
lib/keyringer/completions/zsh/_keyringer
+5
-1
No files found.
lib/keyringer/completions/bash/keyringer
View file @
be12c6d6
...
...
@@ -93,7 +93,7 @@ _keyringer() {
recipients
)
opts
=
"ls edit"
;;
ls
|
tree|mkdir|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|rm|recrypt|open|clip|xclip|find
)
ls
|
tree|mkdir|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|rm|recrypt|open|clip|xclip|find
|mv|cp
)
cur
=
"
`
echo
${
cur
}
|
sed
-e
"s|^/*||"
`
"
# avoid leading slash
opts
=
"
$(
bash
-c
"set -f && export KEYRINGER_CHECK_RECIPIENTS=false && export KEYRINGER_CHECK_VERSION=false && keyringer
$instance
ls -p -d
${
cur
}
*"
2> /dev/null
)
"
;;
...
...
@@ -112,6 +112,10 @@ _keyringer() {
esac
elif
[
"
${#
COMP_WORDS
[@]
}
"
==
"5"
]
;
then
case
"
${
command
}
"
in
mv
|
cp
)
cur
=
"
`
echo
${
cur
}
|
sed
-e
"s|^/*||"
`
"
# avoid leading slash
opts
=
"
$(
bash
-c
"set -f && export KEYRINGER_CHECK_RECIPIENTS=false && export KEYRINGER_CHECK_VERSION=false && keyringer
$instance
ls -p -d
${
cur
}
*"
2> /dev/null
)
"
;;
recipients
)
cur
=
"
`
echo
${
cur
}
|
sed
-e
"s|^/*||"
`
"
# avoid leading slash
opts
=
"
$(
cd
$path
/config/recipients
&&
ls
--color
=
never
-p
${
cur
}*
2> /dev/null
)
"
...
...
lib/keyringer/completions/zsh/_keyringer
View file @
be12c6d6
...
...
@@ -49,7 +49,7 @@ _keyringer() {
recipients)
compadd "$@" ls edit
;;
ls|tree|mkdir|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|rm|recrypt|open|clip|xclip|find)
ls|tree|mkdir|encrypt|encrypt-batch|decrypt|edit|append|append-batch|del|rm|recrypt|open|clip|xclip|find
|mv|cp
)
words[4]="`echo $words[4] | sed -e "s|^/*||"`" # avoid leading slash
compadd "$@" $(KEYRINGER_CHECK_RECIPIENTS=false KEYRINGER_CHECK_VERSION=false keyringer $words[2] ls -p -d $words[4]'*' 2> /dev/null)
;;
...
...
@@ -68,6 +68,10 @@ _keyringer() {
;;
misc)
case "$words[3]" in
mv|cp)
words[5]="`echo $words[5] | sed -e "s|^/*||"`" # avoid leading slash
compadd "$@" $(KEYRINGER_CHECK_RECIPIENTS=false KEYRINGER_CHECK_VERSION=false keyringer $words[2] ls -p -d $words[5]'*' 2> /dev/null)
;;
recipients)
words[5]="$(echo $words[5] | sed -e "s|^/||")" # TODO: avoid leading slash
compadd "$@" $(cd $keyring_path/config/recipients && ls --color=never -p $words[5]* 2> /dev/null)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment