Skip to content

Commit 8399e8f

Browse files
committed
fix(cli): use working directory in cd help
1 parent 7954d02 commit 8399e8f

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

src/cortex-cli/src/agent_cmd/tests.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
#[cfg(test)]
44
mod tests {
55
use crate::agent_cmd::cli::{CopyArgs, ExportArgs};
6-
use crate::agent_cmd::loader::{
7-
load_builtin_agents, parse_frontmatter, read_file_with_encoding,
8-
};
6+
use crate::agent_cmd::loader::{load_builtin_agents, parse_frontmatter};
97
use crate::agent_cmd::types::AgentMode;
8+
use crate::utils::file::read_file_with_encoding;
109

1110
#[test]
1211
fn test_read_file_with_utf8() {

src/cortex-cli/src/cli/args.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ pub struct InteractiveArgs {
187187
)]
188188
pub dangerously_bypass_approvals_and_sandbox: bool,
189189

190-
/// Tell the agent to use the specified directory as its working root
190+
/// Tell the agent to use the specified directory as its working directory
191191
#[arg(
192192
long = "cd",
193193
short = 'C',
@@ -857,6 +857,7 @@ pub struct HistoryClearArgs {
857857
#[cfg(test)]
858858
mod tests {
859859
use super::*;
860+
use clap::CommandFactory;
860861
use clap::Parser;
861862

862863
// ==========================================================================
@@ -969,6 +970,14 @@ mod tests {
969970
assert!(args.prompt.is_empty());
970971
}
971972

973+
#[test]
974+
fn test_cd_help_uses_working_directory() {
975+
let help = Cli::command().render_long_help().to_string();
976+
977+
assert!(help.contains("working directory"));
978+
assert!(!help.contains("working root"));
979+
}
980+
972981
// ==========================================================================
973982
// Cli parsing tests
974983
// ==========================================================================

0 commit comments

Comments
 (0)