From 72c57380883a1c1cc796dea6d35048ab5bed5f53 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Thu, 12 Mar 2026 19:04:12 +0800 Subject: Add helpdoc system with interactive viewer --- src/systems/cmd/cmd_system.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/systems/cmd/cmd_system.rs') diff --git a/src/systems/cmd/cmd_system.rs b/src/systems/cmd/cmd_system.rs index 67f5c7f..3ae4d5e 100644 --- a/src/systems/cmd/cmd_system.rs +++ b/src/systems/cmd/cmd_system.rs @@ -28,7 +28,7 @@ where Collect: Send, { /// Get help string for the command - fn get_help_str() -> String; + fn get_help_str() -> impl Future + Send; /// Run the command and convert the result into type-agnostic serialized information, /// then hand it over to the universal renderer for rendering. @@ -72,7 +72,10 @@ where // skip execution and directly render help information if ctx.help { let mut r = JVRenderResult::default(); - r_println!(r, "{}", Self::get_help_str()); + let help_str = Self::get_help_str().await; + if !help_str.is_empty() { + r_println!(r, "{}", help_str); + } return Ok(r); } @@ -112,7 +115,7 @@ where t = type_name::() ) ); - return Err(CmdProcessError::ParseError(Self::get_help_str())); + return Err(CmdProcessError::ParseError(Self::get_help_str().await)); } }; -- cgit