diff options
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/_registry.rs.template | 6 | ||||
| -rw-r--r-- | templates/command.rs.template | 45 |
2 files changed, 48 insertions, 3 deletions
diff --git a/templates/_registry.rs.template b/templates/_registry.rs.template index cac3c8e..957484c 100644 --- a/templates/_registry.rs.template +++ b/templates/_registry.rs.template @@ -1,6 +1,6 @@ // Auto generated by build.rs -use crate::cmd::cmd_system::{JVCommand, JVCommandContext}; -use crate::cmd::errors::CmdProcessError; +use crate::systems::cmd::cmd_system::{JVCommand, JVCommandContext}; +use crate::systems::cmd::errors::CmdProcessError; <<LINE>> /// Input parameters, execute a command node pub async fn jv_cmd_process_node( @@ -8,7 +8,7 @@ pub async fn jv_cmd_process_node( args: Vec<String>, ctx: JVCommandContext, renderer_override: String -) -> Result<crate::cmd::renderer::JVRenderResult, crate::cmd::errors::CmdProcessError> { +) -> Result<crate::systems::cmd::renderer::JVRenderResult, crate::systems::cmd::errors::CmdProcessError> { match node { // PROCESS // -- TEMPLATE START -- diff --git a/templates/command.rs.template b/templates/command.rs.template new file mode 100644 index 0000000..1c56c29 --- /dev/null +++ b/templates/command.rs.template @@ -0,0 +1,45 @@ +use clap::Parser; +use serde::Serialize; + +use crate::subcmd::{ + cmd::JVCommand, + errors::{CmdExecuteError, CmdPrepareError, CmdRenderError}, + renderer::{JVRenderResult, JVResultRenderer}, +}; + +pub struct JVUnknownCommand; + +#[derive(Parser, Debug)] +pub struct JVUnknownArgument; + +pub struct JVUnknownInput; + +#[derive(Serialize)] +pub struct JVUnknownOutput; + +impl JVCommand<JVUnknownArgument, JVUnknownInput, JVUnknownOutput, JVStatusRenderer> + for JVUnknownCommand +{ + async fn prepare( + _args: JVUnknownArgument, + _ctx: JVCommandContext, + ) -> Result<JVUnknownInput, CmdPrepareError> { + todo!() + } + + async fn exec(_input: JVUnknownInput) -> Result<JVUnknownOutput, CmdExecuteError> { + todo!() + } + + fn get_help_str() -> String { + "".to_string() + } +} + +pub struct JVStatusRenderer; + +impl JVResultRenderer<JVUnknownOutput> for JVStatusRenderer { + async fn render(_data: &JVUnknownOutput) -> Result<JVRenderResult, CmdRenderError> { + todo!() + } +} |
