diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-03-25 21:52:52 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-03-25 21:52:52 +0800 |
| commit | 4cb7c2e91d7dbde32de31e6ab48683d60212ec1d (patch) | |
| tree | 8d70aac6dd33599b278684c05388a319a978b825 /scripts | |
| parent | fece037f453006c83c45825e3649495180eb30c9 (diff) | |
Add shell flag to completion scripts and rename output files
- Add -F flag to all completion scripts to specify shell type
- Rename completion output files to generic names (comp.sh, comp.zsh,
etc.)
- Add help text for jvn_comp program
- Combine specific and default completion results
- Add completion handlers for sheetdump, sheetedit, and version commands
- Remove word count limits from workspace_alias and workspace_sheet
completions
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/deploy/completions/bash.sh | 1 | ||||
| -rw-r--r-- | scripts/deploy/completions/fish.fish | 3 | ||||
| -rw-r--r-- | scripts/deploy/completions/powershell.ps1 | 1 | ||||
| -rw-r--r-- | scripts/deploy/completions/zsh.zsh | 1 | ||||
| -rw-r--r-- | scripts/deploy/jvn.ps1 | 2 | ||||
| -rw-r--r-- | scripts/deploy/jvn_bash.sh | 4 | ||||
| -rw-r--r-- | scripts/deploy/jvn_fish.fish | 4 | ||||
| -rw-r--r-- | scripts/deploy/jvn_zsh.zsh | 4 |
8 files changed, 13 insertions, 7 deletions
diff --git a/scripts/deploy/completions/bash.sh b/scripts/deploy/completions/bash.sh index a9a3263..647b5bb 100644 --- a/scripts/deploy/completions/bash.sh +++ b/scripts/deploy/completions/bash.sh @@ -13,6 +13,7 @@ _jvn_bash_completion() { args+=(-p="${prev//-/^}") args+=(-c="${COMP_WORDS[0]//-/^}") args+=(-i="$word_index") + args+=(-F="bash") for word in "${COMP_WORDS[@]}"; do args+=(-a="${word//-/^}") diff --git a/scripts/deploy/completions/fish.fish b/scripts/deploy/completions/fish.fish index eb2c2df..45205a3 100644 --- a/scripts/deploy/completions/fish.fish +++ b/scripts/deploy/completions/fish.fish @@ -67,6 +67,9 @@ function __jvn_fish_complete set -a args -a "" end + # Add shell type argument + set -a args -F "fish" + # Call jvn_comp and handle output set -l output if not jvn_comp $args 2>/dev/null | read -z output diff --git a/scripts/deploy/completions/powershell.ps1 b/scripts/deploy/completions/powershell.ps1 index ec91038..e393e52 100644 --- a/scripts/deploy/completions/powershell.ps1 +++ b/scripts/deploy/completions/powershell.ps1 @@ -25,6 +25,7 @@ Register-ArgumentCompleter -CommandName jvn -ScriptBlock { "-c", $commandName "-i", ($words.Count - 1).ToString() "-a", ($words | ForEach-Object { $_ -replace '-', '^' }) + "-F", "powershell" ) $suggestions = jvn_comp $args 2>$null diff --git a/scripts/deploy/completions/zsh.zsh b/scripts/deploy/completions/zsh.zsh index dd1ff38..2b9e7f9 100644 --- a/scripts/deploy/completions/zsh.zsh +++ b/scripts/deploy/completions/zsh.zsh @@ -22,6 +22,7 @@ _jvn_completion() { -c "$command_name" -i "$word_index" -a "${(@)words//-/^}" + -F "zsh" ) suggestions=$(jvn_comp "${args[@]}" 2>/dev/null) diff --git a/scripts/deploy/jvn.ps1 b/scripts/deploy/jvn.ps1 index 64959d0..495ed43 100644 --- a/scripts/deploy/jvn.ps1 +++ b/scripts/deploy/jvn.ps1 @@ -1,7 +1,7 @@ $SCRIPT_DIR = Split-Path -Parent $MyInvocation.MyCommand.Definition # Completion -$completionScript = Join-Path $SCRIPT_DIR "comp\jvn_pwsl.ps1" +$completionScript = Join-Path $SCRIPT_DIR "comp\comp.ps1" if (Test-Path $completionScript) { . $completionScript } diff --git a/scripts/deploy/jvn_bash.sh b/scripts/deploy/jvn_bash.sh index 0320127..6feafb0 100644 --- a/scripts/deploy/jvn_bash.sh +++ b/scripts/deploy/jvn_bash.sh @@ -9,8 +9,8 @@ fi # Completion script if [ -n "$BASH_VERSION" ]; then - if [ -f "$SCRIPT_DIR/comp/jvn_bash.sh" ]; then - source "$SCRIPT_DIR/comp/jvn_bash.sh" + if [ -f "$SCRIPT_DIR/comp/comp.sh" ]; then + source "$SCRIPT_DIR/comp/comp.sh" else echo "Error: Completion script not found at $SCRIPT_DIR/comp/jvn_bash.sh" >&2 fi diff --git a/scripts/deploy/jvn_fish.fish b/scripts/deploy/jvn_fish.fish index f9dd2a2..1a97984 100644 --- a/scripts/deploy/jvn_fish.fish +++ b/scripts/deploy/jvn_fish.fish @@ -2,8 +2,8 @@ set SCRIPT_DIR (dirname (status --current-filename)) # Completion script -if test -f "$SCRIPT_DIR/comp/jvn_fish.fish" - source "$SCRIPT_DIR/comp/jvn_fish.fish" +if test -f "$SCRIPT_DIR/comp/comp.fish" + source "$SCRIPT_DIR/comp/comp.fish" end # Environment diff --git a/scripts/deploy/jvn_zsh.zsh b/scripts/deploy/jvn_zsh.zsh index 25f8304..d86585a 100644 --- a/scripts/deploy/jvn_zsh.zsh +++ b/scripts/deploy/jvn_zsh.zsh @@ -2,8 +2,8 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" # Completion script -if [ -f "$SCRIPT_DIR/comp/jvn_zsh.zsh" ]; then - source "$SCRIPT_DIR/comp/jvn_zsh.zsh" +if [ -f "$SCRIPT_DIR/comp/comp.zsh" ]; then + source "$SCRIPT_DIR/comp/comp.zsh" fi # Environment |
