diff options
| author | Weicao-CatilGrass <1992414357@qq.com> | 2026-06-09 17:12:50 +0800 |
|---|---|---|
| committer | Weicao-CatilGrass <1992414357@qq.com> | 2026-06-09 17:14:08 +0800 |
| commit | f7ce99550595915efb3d3f7774095976cb3b763b (patch) | |
| tree | 378bdacea64bb22d41844eb9298c6b67b260f8b5 /mingling_core/src/comp.rs | |
| parent | bcdd642b269a3342a07d625139c647b0501fa7c7 (diff) | |
Add COMPLETION_SUBCOMMAND and is_completing method
Diffstat (limited to 'mingling_core/src/comp.rs')
| -rw-r--r-- | mingling_core/src/comp.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mingling_core/src/comp.rs b/mingling_core/src/comp.rs index 1769a5c..bf7ab13 100644 --- a/mingling_core/src/comp.rs +++ b/mingling_core/src/comp.rs @@ -1,3 +1,4 @@ +mod comp_ctx; mod flags; mod shell_ctx; mod suggest; @@ -5,6 +6,16 @@ mod suggest; use std::collections::BTreeSet; use std::fmt::Display; +/// Constant defining the name of the completion subcommand. +/// +/// When a user invokes this subcommand (e.g., `your_program __comp`), the +/// program enters completion mode and generates shell completions based on +/// the current shell context. +/// +/// This value is used internally by the completion system to intercept the +/// command-line input and redirect to the completion handler. +pub const COMPLETION_SUBCOMMAND: &str = "__comp"; + #[doc(hidden)] pub use flags::*; #[doc(hidden)] |
