From 1804e265b4b096bc1c2eb08869e33299ff11e93c Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 17 Nov 2025 17:42:36 +0800 Subject: Add login command combining account setup and vault connection The new `jv login` command streamlines the process of setting up a workspace by combining account selection, vault connection, and initial sync into a single operation. - Add completion support for login command - Update help documentation in both English and Chinese - Add confirmation prompt for login operation --- scripts/completion_jv.sh | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) mode change 100755 => 100644 scripts/completion_jv.sh (limited to 'scripts') diff --git a/scripts/completion_jv.sh b/scripts/completion_jv.sh old mode 100755 new mode 100644 index 0532bad..51bd242 --- 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") -- cgit