summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--[-rwxr-xr-x]scripts/completion_jv.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/completion_jv.sh b/scripts/completion_jv.sh
index 69614ce..43c8f70 100755..100644
--- a/scripts/completion_jv.sh
+++ b/scripts/completion_jv.sh
@@ -22,7 +22,7 @@ _jv_completion() {
jump align"
# Subcommands - Account
- local account_commands="list as add remove movekey mvkey mvk help"
+ local account_commands="list as add remove movekey mvkey mvk genpub help"
# Subcommands - Sheet
local sheet_commands="list use exit make drop help"
@@ -44,16 +44,25 @@ _jv_completion() {
fi
case "$subsubcmd" in
- "as"|"remove"|"mvkey"|"mvk"|"movekey")
+ "as"|"remove"|"mvkey"|"mvk"|"movekey"|"genpub")
if [[ $cword -eq 3 ]]; then
# Use jv account list --raw
local accounts
accounts=$($cmd account list --raw 2>/dev/null)
COMPREPLY=($(compgen -W "$accounts" -- "$cur"))
- elif [[ $cword -eq 4 && ("$subsubcmd" == "mvkey" || "$subsubcmd" == "mvk" || "$subsubcmd" == "movekey") ]]; then
+ elif [[ $cword -eq 4 && ("$subsubcmd" == "mvkey" || "$subsubcmd" == "mvk" || "$subsubcmd" == "movekey" || "$subsubcmd" == "genpub") ]]; then
COMPREPLY=($(compgen -f -- "$cur"))
fi
;;
+ "add")
+ if [[ $cword -eq 3 ]]; then
+ # No completion for account name, let user type it
+ COMPREPLY=()
+ elif [[ $cword -eq 4 && "$cur" == -* ]]; then
+ # Complete --keygen option
+ COMPREPLY=($(compgen -W "--keygen" -- "$cur"))
+ fi
+ ;;
"-"|"rm")
if [[ $cword -eq 3 ]]; then
local accounts