diff options
Diffstat (limited to 'scripts')
| -rw-r--r--[-rwxr-xr-x] | scripts/completion_jv.sh | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/scripts/completion_jv.sh b/scripts/completion_jv.sh index 0532bad..51bd242 100755..100644 --- a/scripts/completion_jv.sh +++ b/scripts/completion_jv.sh @@ -14,7 +14,7 @@ _jv_completion() { local subsubcmd="${words[2]}" # Subcommands - local base_commands="create init direct unstain account update sheet status here import export in out move mv docs exit use sheets accounts as make drop track hold throw" + local base_commands="create init direct unstain account update sheet status here import export in out move mv docs exit use sheets accounts as make drop track hold throw login" # Subcommands - Account local account_commands="list as add remove movekey mvkey mvk help" @@ -87,6 +87,30 @@ _jv_completion() { return 0 fi + # Completion login + if [[ "$subcmd" == "login" ]]; then + if [[ $cword -eq 2 ]]; then + local accounts + accounts=$($cmd account list --raw 2>/dev/null) + COMPREPLY=($(compgen -W "$accounts" -- "$cur")) + elif [[ $cword -eq 3 ]]; then + local ip_history + ip_history=$($cmd _ip_history 2>/dev/null) + COMPREPLY=($(compgen -W "$ip_history" -- "$cur")) + fi + return 0 + fi + + # Completion direct + if [[ "$subcmd" == "direct" ]]; then + if [[ $cword -eq 2 ]]; then + local ip_history + ip_history=$($cmd _ip_history 2>/dev/null) + COMPREPLY=($(compgen -W "$ip_history" -- "$cur")) + fi + return 0 + fi + # aliases case "$subcmd" in "as") |
