From 4cb7c2e91d7dbde32de31e6ab48683d60212ec1d Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Wed, 25 Mar 2026 21:52:52 +0800 Subject: 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 --- src/systems/comp/context.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/systems') diff --git a/src/systems/comp/context.rs b/src/systems/comp/context.rs index 7fb8f43..8d0adc2 100644 --- a/src/systems/comp/context.rs +++ b/src/systems/comp/context.rs @@ -1,4 +1,12 @@ -use clap::Parser; +use clap::{Parser, ValueEnum}; + +#[derive(ValueEnum, Debug, Clone, Copy)] +pub enum ShellFlag { + Zsh, + Bash, + Fish, + Powershell, +} #[derive(Parser, Debug, Clone)] #[command(author, version, about, long_about = None)] @@ -30,4 +38,8 @@ pub struct CompletionContext { /// All words #[arg(short = 'a', long, num_args = 1..)] pub all_words: Vec, + + /// Flag to indicate completion context + #[arg(short = 'F', long, value_enum)] + pub shell_flag: ShellFlag, } -- cgit