summaryrefslogtreecommitdiff
path: root/templates/_registry.rs.template
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-01-22 08:32:29 +0800
committer魏曹先生 <1992414357@qq.com>2026-01-22 08:32:29 +0800
commitaca8b408755f9041da9ee083c625de2a8d8c6785 (patch)
tree5747d389d5218ccf39e2153ae1346f7b5bfe8fb8 /templates/_registry.rs.template
parent0d614f3e2104e9b840ebc7e53a6caa6af1671636 (diff)
Refactor CLI command processing with new architecture
Diffstat (limited to 'templates/_registry.rs.template')
-rw-r--r--templates/_registry.rs.template25
1 files changed, 25 insertions, 0 deletions
diff --git a/templates/_registry.rs.template b/templates/_registry.rs.template
new file mode 100644
index 0000000..0c6d0d5
--- /dev/null
+++ b/templates/_registry.rs.template
@@ -0,0 +1,25 @@
+// Auto generated by build.rs
+use crate::subcmd::cmd::{JVCommand, JVCommandContext};
+use crate::subcmd::errors::CmdProcessError;
+<<LINE>>
+/// Input parameters, execute a command node
+pub async fn jv_cmd_process_node(
+ node: &str,
+ args: Vec<String>,
+ ctx: JVCommandContext
+) -> Result<crate::subcmd::renderer::JVRenderResult, crate::subcmd::errors::CmdProcessError> {
+ match node {
+// PROCESS
+// -- TEMPLATE START --
+ // Command `<<KEY>>`
+ "<<NODE_NAME>>" => return crate::<<COMMAND_TYPE>>::process(args, ctx).await,
+// -- TEMPLATE END --
+ _ => {}
+ }
+ return Err(CmdProcessError::NoNodeFound(node.to_string()));
+}
+<<LINE>>
+/// Get all command nodes
+pub fn jv_cmd_nodes() -> Vec<String> {
+ vec!<<NODES>>
+}