@@ -118,11 +118,12 @@ impl Prompt {
118118 fn save_content ( & self , content : & str ) -> Result < ( ) , GetPromptError > {
119119 // Validate argument placeholders before saving
120120 if let Err ( arg_error) = validate_placeholders ( content) {
121- return Err ( GetPromptError :: General (
122- eyre:: eyre!( "Invalid argument placeholders: {}" , arg_error)
123- ) ) ;
121+ return Err ( GetPromptError :: General ( eyre:: eyre!(
122+ "Invalid argument placeholders: {}" ,
123+ arg_error
124+ ) ) ) ;
124125 }
125-
126+
126127 // Ensure parent directory exists
127128 if let Some ( parent) = self . path . parent ( ) {
128129 fs:: create_dir_all ( parent) . map_err ( GetPromptError :: Io ) ?;
@@ -755,12 +756,15 @@ impl PromptsArgs {
755756 ) ?;
756757 for name in & global_prompts {
757758 let prompts = Prompts :: new ( name, os) . map_err ( |e| ChatError :: Custom ( e. to_string ( ) . into ( ) ) ) ?;
758- let arg_count = if let Some ( ( content, _) ) = prompts. load_existing ( ) . map_err ( |e| ChatError :: Custom ( e. to_string ( ) . into ( ) ) ) ? {
759+ let arg_count = if let Some ( ( content, _) ) = prompts
760+ . load_existing ( )
761+ . map_err ( |e| ChatError :: Custom ( e. to_string ( ) . into ( ) ) ) ?
762+ {
759763 count_arguments ( & content)
760764 } else {
761765 0
762766 } ;
763-
767+
764768 queue ! ( session. stderr, style:: Print ( "- " ) , style:: Print ( name) ) ?;
765769 if arg_count > 0 {
766770 queue ! (
@@ -788,12 +792,15 @@ impl PromptsArgs {
788792 for name in & local_prompts {
789793 let has_global_version = overridden_globals. contains ( name) ;
790794 let prompts = Prompts :: new ( name, os) . map_err ( |e| ChatError :: Custom ( e. to_string ( ) . into ( ) ) ) ?;
791- let arg_count = if let Some ( ( content, _) ) = prompts. load_existing ( ) . map_err ( |e| ChatError :: Custom ( e. to_string ( ) . into ( ) ) ) ? {
795+ let arg_count = if let Some ( ( content, _) ) = prompts
796+ . load_existing ( )
797+ . map_err ( |e| ChatError :: Custom ( e. to_string ( ) . into ( ) ) ) ?
798+ {
792799 count_arguments ( & content)
793800 } else {
794801 0
795802 } ;
796-
803+
797804 queue ! ( session. stderr, style:: Print ( "- " ) , style:: Print ( name) , ) ?;
798805 if arg_count > 0 {
799806 queue ! (
@@ -1299,7 +1306,7 @@ impl PromptsSubcommand {
12991306 style:: Print ( "@" ) ,
13001307 style:: Print ( name) ,
13011308 ) ?;
1302-
1309+
13031310 // Show argument placeholders if any exist
13041311 if arg_count > 0 {
13051312 if has_args {
@@ -1316,12 +1323,8 @@ impl PromptsSubcommand {
13161323 }
13171324 }
13181325 }
1319-
1320- queue ! (
1321- session. stderr,
1322- StyledText :: reset( ) ,
1323- style:: Print ( "\n \n " ) ,
1324- ) ?;
1326+
1327+ queue ! ( session. stderr, StyledText :: reset( ) , style:: Print ( "\n \n " ) , ) ?;
13251328
13261329 // Display argument information
13271330 if arg_count > 0 {
@@ -1332,7 +1335,7 @@ impl PromptsSubcommand {
13321335 StyledText :: reset_attributes( ) ,
13331336 style:: Print ( "\n " ) ,
13341337 ) ?;
1335-
1338+
13361339 if has_args {
13371340 queue ! (
13381341 session. stderr,
@@ -1345,7 +1348,7 @@ impl PromptsSubcommand {
13451348 style:: Print ( " - All provided arguments\n " ) ,
13461349 ) ?;
13471350 }
1348-
1351+
13491352 if let Ok ( positions) = validate_placeholders ( content) {
13501353 for pos in positions {
13511354 queue ! (
@@ -1447,7 +1450,9 @@ impl PromptsSubcommand {
14471450 session. stderr,
14481451 style:: Print ( "\n " ) ,
14491452 StyledText :: warning_fg( ) ,
1450- style:: Print ( "⚠ Warning: More arguments provided than expected. Ignoring extra arguments.\n " ) ,
1453+ style:: Print (
1454+ "⚠ Warning: More arguments provided than expected. Ignoring extra arguments.\n "
1455+ ) ,
14511456 StyledText :: reset( ) ,
14521457 ) ?;
14531458 execute ! ( session. stderr) ?;
@@ -1468,7 +1473,7 @@ impl PromptsSubcommand {
14681473 return Ok ( ChatState :: PromptUser {
14691474 skip_printing_tools : true ,
14701475 } ) ;
1471- }
1476+ } ,
14721477 }
14731478 } else {
14741479 content. clone ( )
0 commit comments