From 626536ce51975b051fea087620bc1eb7f6bc69d3 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Fri, 23 Jan 2026 04:49:34 +0800 Subject: Reorganize project structure into systems and assets --- src/cmd/processer.rs | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 src/cmd/processer.rs (limited to 'src/cmd/processer.rs') diff --git a/src/cmd/processer.rs b/src/cmd/processer.rs deleted file mode 100644 index f5fc2a6..0000000 --- a/src/cmd/processer.rs +++ /dev/null @@ -1,41 +0,0 @@ -use crate::cmd::cmd_system::JVCommandContext; -use crate::cmd::cmds::_registry::{jv_cmd_nodes, jv_cmd_process_node}; -use crate::cmd::errors::CmdProcessError; -use crate::cmd::renderer::JVRenderResult; - -pub async fn jv_cmd_process( - args: Vec, - ctx: JVCommandContext, - renderer_override: String, -) -> Result { - let nodes = jv_cmd_nodes(); - let command = args.join(" "); - - // Find nodes that match the beginning of the command - let matching_nodes: Vec<&String> = nodes - .iter() - .filter(|node| command.starts_with(node.as_str())) - .collect(); - - match matching_nodes.len() { - 0 => { - // No matching node found - return Err(CmdProcessError::NoMatchingCommand); - } - 1 => { - let matched_prefix = matching_nodes[0]; - let prefix_len = matched_prefix.split_whitespace().count(); - let trimmed_args: Vec = args.into_iter().skip(prefix_len).collect(); - return jv_cmd_process_node(matched_prefix, trimmed_args, ctx, renderer_override).await; - } - _ => { - // Multiple matching nodes found - return Err(CmdProcessError::AmbiguousCommand( - matching_nodes - .iter() - .map(|s| s.to_string()) - .collect::>(), - )); - } - } -} -- cgit