File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33#[ cfg( test) ]
44mod 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 ( ) {
Original file line number Diff line number Diff line change @@ -805,6 +805,9 @@ pub struct ServersRefreshArgs {
805805
806806/// History command - view past prompts and sessions.
807807#[ derive( Args ) ]
808+ #[ command(
809+ after_help = "With no subcommand, list recent prompts. Use search to filter history or clear to delete it."
810+ ) ]
808811pub struct HistoryCommand {
809812 #[ command( subcommand) ]
810813 pub action : Option < HistorySubcommand > ,
@@ -857,7 +860,7 @@ pub struct HistoryClearArgs {
857860#[ cfg( test) ]
858861mod tests {
859862 use super :: * ;
860- use clap:: Parser ;
863+ use clap:: { CommandFactory , Parser } ;
861864
862865 // ==========================================================================
863866 // LogLevel tests
@@ -1782,6 +1785,18 @@ mod tests {
17821785 }
17831786 }
17841787
1788+ #[ test]
1789+ fn test_history_help_documents_default_list_behavior ( ) {
1790+ let mut cmd = Cli :: command ( ) ;
1791+ let help = cmd
1792+ . find_subcommand_mut ( "history" )
1793+ . expect ( "history subcommand should exist" )
1794+ . render_help ( )
1795+ . to_string ( ) ;
1796+
1797+ assert ! ( help. contains( "With no subcommand, list recent prompts." ) ) ;
1798+ }
1799+
17851800 #[ test]
17861801 fn test_history_command_with_limit ( ) {
17871802 let cli = Cli :: try_parse_from ( [ "cortex" , "history" , "-n" , "50" ] )
You can’t perform that action at this time.
0 commit comments