summaryrefslogtreecommitdiff
path: root/src/cmds/comp
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-03-18 22:50:03 +0800
committer魏曹先生 <1992414357@qq.com>2026-03-18 22:50:03 +0800
commit74bc8902be593796eb6292151e08374072766e3e (patch)
treef3de024bf06753649ff2a51587ee5e54a1c92435 /src/cmds/comp
parent5372793a49567dcba7315bf8e7bc5a1cab2d5a76 (diff)
Add workspace sheet command with help and localization
Diffstat (limited to 'src/cmds/comp')
-rw-r--r--src/cmds/comp/workspace_sheet.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/cmds/comp/workspace_sheet.rs b/src/cmds/comp/workspace_sheet.rs
new file mode 100644
index 0000000..3d7e6d5
--- /dev/null
+++ b/src/cmds/comp/workspace_sheet.rs
@@ -0,0 +1,20 @@
+use crate::systems::comp::context::CompletionContext;
+use just_enough_vcs::system::workspace::workspace::manager::WorkspaceManager;
+
+pub fn comp(ctx: CompletionContext) -> Option<Vec<String>> {
+ if ctx.current_word.starts_with('-') {
+ return Some(vec![
+ "--list-all".to_string(),
+ "--print-path".to_string(),
+ "--new".to_string(),
+ "--delete".to_string(),
+ ]);
+ }
+
+ if ctx.previous_word == "--new" || ctx.previous_word == "-n" {
+ return Some(vec![]);
+ }
+
+ let rt = tokio::runtime::Runtime::new().unwrap();
+ Some(rt.block_on(WorkspaceManager::new().list_sheet_names()))
+}