summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
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,
+ )));
+ }
+}