diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-03-15 01:12:06 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-03-15 01:12:06 +0800 |
| commit | 10ed02b8541a80e60f7ad9f9fb51f8070d6be525 (patch) | |
| tree | bfc034d1ad0c2d5567a53ece074932040dfb8d43 /src/cmds/comp/helpdoc.rs | |
| parent | 72f80ea51f25256d0c463c2f3dc3d8670cfc4634 (diff) | |
Add completions system for shell autocompletion
Diffstat (limited to 'src/cmds/comp/helpdoc.rs')
| -rw-r--r-- | src/cmds/comp/helpdoc.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cmds/comp/helpdoc.rs b/src/cmds/comp/helpdoc.rs new file mode 100644 index 0000000..7f07cad --- /dev/null +++ b/src/cmds/comp/helpdoc.rs @@ -0,0 +1,13 @@ +use crate::systems::{comp::context::CompletionContext, helpdoc}; + +pub fn comp(ctx: CompletionContext) -> Option<Vec<String>> { + if ctx.previous_word == "helpdoc" { + return Some( + helpdoc::get_helpdoc_list() + .iter() + .map(|s| s.to_string()) + .collect(), + ); + } + None +} |
