summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-01-22 14:24:50 +0800
committer魏曹先生 <1992414357@qq.com>2026-01-22 14:24:50 +0800
commit47bf9b75f6dd8c2d3c3f1fb947a16e0e055f49cf (patch)
treec767e331e68134e19caeeb03269525be7b4fe6e1 /templates
parent53c26d656f975f93319dd432e409c1ea740ce06d (diff)
Add renderer system and implement status command
Diffstat (limited to 'templates')
-rw-r--r--templates/_registry.rs.template12
-rw-r--r--templates/renderer_list.txt16
2 files changed, 26 insertions, 2 deletions
diff --git a/templates/_registry.rs.template b/templates/_registry.rs.template
index fd6f779..cac3c8e 100644
--- a/templates/_registry.rs.template
+++ b/templates/_registry.rs.template
@@ -6,13 +6,21 @@ use crate::cmd::errors::CmdProcessError;
pub async fn jv_cmd_process_node(
node: &str,
args: Vec<String>,
- ctx: JVCommandContext
+ ctx: JVCommandContext,
+ renderer_override: String
) -> Result<crate::cmd::renderer::JVRenderResult, crate::cmd::errors::CmdProcessError> {
match node {
// PROCESS
// -- TEMPLATE START --
// Command `<<KEY>>`
- "<<NODE_NAME>>" => return crate::<<COMMAND_TYPE>>::process(args, ctx).await,
+ "<<NODE_NAME>>" => {
+ return crate::<<COMMAND_TYPE>>::process_with_renderer_flag(
+ args,
+ ctx,
+ renderer_override
+ )
+ .await;
+ }
// -- TEMPLATE END --
_ => {}
}
diff --git a/templates/renderer_list.txt b/templates/renderer_list.txt
new file mode 100644
index 0000000..cfc8105
--- /dev/null
+++ b/templates/renderer_list.txt
@@ -0,0 +1,16 @@
+match renderer_str {
+// MATCH
+// -- TEMPLATE START --
+ "<<NAME>>" => {
+ Self::process_with_renderer::<
+ <<TYPE>>,
+ >(args, ctx)
+ .await
+ }
+// -- TEMPLATE END --
+ _ => {
+ return Err(CmdProcessError::Render(CmdRenderError::RendererNotFound(
+ renderer,
+ )));
+ }
+}