summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2025-11-22 20:16:14 +0800
committer魏曹先生 <1992414357@qq.com>2025-11-22 20:16:14 +0800
commit97089d19a4b339a622d78e48a41f1d67273752fd (patch)
treec149fb23c9d6ea6b4c54ad048891fc0f323ea345 /scripts
parent34abfcdc8e148c047ebb2e06539036e514df7046 (diff)
Add account key generation and public key export features
- Add `--keygen` flag to `account add` for automatic ED25519 key generation - Add `account genpub` command to export public keys - Update help documentation in both English and Chinese - Extend shell completion for new commands - Add error handling for OpenSSL operations
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