From 47bf9b75f6dd8c2d3c3f1fb947a16e0e055f49cf Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Thu, 22 Jan 2026 14:24:50 +0800 Subject: Add renderer system and implement status command --- src/cmd/cmd_system.rs | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'src/cmd/cmd_system.rs') diff --git a/src/cmd/cmd_system.rs b/src/cmd/cmd_system.rs index 3edd5cc..229c7f0 100644 --- a/src/cmd/cmd_system.rs +++ b/src/cmd/cmd_system.rs @@ -2,7 +2,7 @@ use serde::Serialize; use crate::{ cmd::{ - errors::{CmdExecuteError, CmdPrepareError, CmdProcessError}, + errors::{CmdExecuteError, CmdPrepareError, CmdProcessError, CmdRenderError}, renderer::{JVRenderResult, JVResultRenderer}, }, r_println, @@ -24,11 +24,30 @@ where /// Get help string for the command fn get_help_str() -> String; + /// Process the command with a specified renderer, performing any necessary post-execution processing + #[rustfmt::skip] + fn process_with_renderer_flag( + args: Vec, + ctx: JVCommandContext, + renderer: String, + ) -> impl Future> + Send + where + Self: Sync, + { + async move { + let renderer_str = renderer.as_str(); + include!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/src/cmd/renderers/renderer_list.txt" + )) + } + } + /// performing any necessary post-execution processing fn process( args: Vec, ctx: JVCommandContext, - ) -> impl Future> + Send + Sync + ) -> impl Future> + Send where Self: Sync, { @@ -40,7 +59,7 @@ where fn process_with_renderer + Send + Sync>( args: Vec, ctx: JVCommandContext, - ) -> impl Future> + Send + Sync + ) -> impl Future> + Send where Self: Sync, { @@ -77,9 +96,9 @@ where fn prepare( args: Argument, ctx: JVCommandContext, - ) -> impl Future> + Send + Sync; + ) -> impl Future> + Send; /// Run the command phase, /// returning an output structure, waiting for rendering - fn exec(args: Input) -> impl Future> + Send + Sync; + fn exec(input: Input) -> impl Future> + Send; } -- cgit