From 3d4c73ac31853eddbe8200e03c035a8a48f0217f Mon Sep 17 00:00:00 2001 From: Droid Date: Mon, 26 Jan 2026 17:58:23 +0400 Subject: [PATCH] fix(cli): parse flags correctly when mixed with positional args Fixes bounty issue #1523 The 'message' argument was configured with trailing_var_arg=true, which caused all subsequent flags to be treated as part of the message string. This prevented valid flags like --continue or --session from working when specified after the message. By removing this attribute, flags are now correctly parsed regardless of their position relative to the message argument. Also fixed a compilation error in cortex-engine/src/tasks/snapshot.rs where 'permissions' variable was ignored in pattern match but used in conditional compilation block. --- cortex-cli/src/run_cmd.rs | 1 - cortex-engine/src/tasks/snapshot.rs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cortex-cli/src/run_cmd.rs b/cortex-cli/src/run_cmd.rs index 8318b34e..f2e1cc32 100644 --- a/cortex-cli/src/run_cmd.rs +++ b/cortex-cli/src/run_cmd.rs @@ -57,7 +57,6 @@ impl std::fmt::Display for OutputFormat { pub struct RunCli { /// Message to send to the AI agent. /// Multiple arguments are joined with spaces. - #[arg(trailing_var_arg = true)] pub message: Vec, /// Execute a predefined command instead of a prompt. diff --git a/cortex-engine/src/tasks/snapshot.rs b/cortex-engine/src/tasks/snapshot.rs index a25ac7ca..21f3a49e 100644 --- a/cortex-engine/src/tasks/snapshot.rs +++ b/cortex-engine/src/tasks/snapshot.rs @@ -292,7 +292,7 @@ impl SnapshotManager { match state { FileState::Exists { content, - permissions: _, + permissions, .. } => { // Create parent directories