Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/cortex-cli/src/agent_cmd/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
#[cfg(test)]
mod tests {
use crate::agent_cmd::cli::{CopyArgs, ExportArgs};
use crate::agent_cmd::loader::{
load_builtin_agents, parse_frontmatter, read_file_with_encoding,
};
use crate::agent_cmd::loader::{load_builtin_agents, parse_frontmatter};
use crate::agent_cmd::types::AgentMode;
use crate::utils::file::read_file_with_encoding;

#[test]
fn test_read_file_with_utf8() {
Expand Down
17 changes: 16 additions & 1 deletion src/cortex-cli/src/cli/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,9 @@ pub struct ServersRefreshArgs {

/// History command - view past prompts and sessions.
#[derive(Args)]
#[command(
after_help = "With no subcommand, list recent prompts. Use search to filter history or clear to delete it."
)]
pub struct HistoryCommand {
#[command(subcommand)]
pub action: Option<HistorySubcommand>,
Expand Down Expand Up @@ -857,7 +860,7 @@ pub struct HistoryClearArgs {
#[cfg(test)]
mod tests {
use super::*;
use clap::Parser;
use clap::{CommandFactory, Parser};

// ==========================================================================
// LogLevel tests
Expand Down Expand Up @@ -1782,6 +1785,18 @@ mod tests {
}
}

#[test]
fn test_history_help_documents_default_list_behavior() {
let mut cmd = Cli::command();
let help = cmd
.find_subcommand_mut("history")
.expect("history subcommand should exist")
.render_help()
.to_string();

assert!(help.contains("With no subcommand, list recent prompts."));
}

#[test]
fn test_history_command_with_limit() {
let cli = Cli::try_parse_from(["cortex", "history", "-n", "50"])
Expand Down