Skip to content

Commit c2e5b4c

Browse files
committed
parse help
1 parent d6f39cf commit c2e5b4c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

crates/q_cli/src/cli/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ pub enum CliRootCommands {
201201
args: Vec<String>,
202202
},
203203
/// Model Context Protocol (MCP)
204+
#[command(disable_help_flag = true)]
204205
Mcp {
205206
/// Args for the MCP subcommand (passed through to `qchat mcp …`)
206207
#[arg(trailing_var_arg = true, allow_hyphen_values = true)]
@@ -352,7 +353,12 @@ impl Cli {
352353
CliRootCommands::Version { changelog } => Self::print_version(changelog),
353354
CliRootCommands::Dashboard => launch_dashboard(false).await,
354355
CliRootCommands::Chat { args } => Self::execute_chat("chat", Some(args), true).await,
355-
CliRootCommands::Mcp { args } => Self::execute_chat("mcp", Some(args), true).await,
356+
CliRootCommands::Mcp { mut args } => {
357+
if args.is_empty() || matches!(args.get(0).map(|s| s.as_str()), Some("--help" | "-h")) {
358+
args = vec!["--help".into()];
359+
}
360+
Self::execute_chat("mcp", Some(args), true).await
361+
},
356362
CliRootCommands::Inline(subcommand) => subcommand.execute(&cli_context).await,
357363
},
358364
// Root command

0 commit comments

Comments
 (0)