Skip to content

Commit 832e9fb

Browse files
factorydroidechobt
authored andcommitted
fix(cli): allow hyphen-prefixed values in prompt arguments
Fixes bounty issue #1513 The message and prompt arguments using trailing_var_arg were missing the allow_hyphen_values attribute, causing clap to misinterpret prompts starting with '-' (like '-hello') as flags instead of prompt text.
1 parent 9859896 commit 832e9fb

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

cortex-cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ struct InteractiveArgs {
115115
debug: bool,
116116

117117
/// Initial prompt (if no subcommand)
118-
#[arg(trailing_var_arg = true)]
118+
#[arg(trailing_var_arg = true, allow_hyphen_values = true)]
119119
prompt: Vec<String>,
120120
}
121121

cortex-cli/src/run_cmd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl std::fmt::Display for OutputFormat {
5757
pub struct RunCli {
5858
/// Message to send to the AI agent.
5959
/// Multiple arguments are joined with spaces.
60-
#[arg(trailing_var_arg = true)]
60+
#[arg(trailing_var_arg = true, allow_hyphen_values = true)]
6161
pub message: Vec<String>,
6262

6363
/// Execute a predefined command instead of a prompt.

0 commit comments

Comments
 (0)