@@ -21,7 +21,7 @@ component aliases="wheels g code" extends="../base" {
2121 * @force.hint Overwrite existing files
2222 */
2323 function run (
24- required string pattern ,
24+ string pattern ,
2525 boolean list = false ,
2626 string category = " " ,
2727 string output = " console" ,
@@ -53,16 +53,16 @@ component aliases="wheels g code" extends="../base" {
5353
5454 if (! len (arguments .pattern )) {
5555 detailOutput .error (" Pattern name is required" );
56- detailOutput .getPrint (). line ( " Usage: wheels g code <pattern-name>" );
57- detailOutput .getPrint (). line ( " Run 'wheels g code --list' to see available patterns" );
56+ detailOutput .output ( " Usage: wheels g code <pattern-name>" , true );
57+ detailOutput .output ( " Run 'wheels g code --list' to see available patterns" , true );
5858 setExitCode (1 );
5959 return ;
6060 }
6161
6262 var snippet = getSnippetByName (arguments .pattern );
6363 if (! structCount (snippet )) {
6464 detailOutput .error (" Code snippet '#arguments .pattern #' not found" );
65- detailOutput .getPrint (). line ( " Run 'wheels g code --list' to see available patterns" );
65+ detailOutput .output ( " Run 'wheels g code --list' to see available patterns" , true );
6666 setExitCode (1 );
6767 return ;
6868 }
@@ -102,16 +102,16 @@ component aliases="wheels g code" extends="../base" {
102102 for (var cat in categoryOrder ) {
103103 var key = lCase (cat );
104104 if (structKeyExists (categories , key )) {
105- detailOutput .getPrint (). line (" " );
106- detailOutput .getPrint ().boldLine (" #cat #:" );
105+ detailOutput .line ();
106+ detailOutput .getPrint ().boldLine (" #cat #:" ). toConsole () ;
107107 for (var snippet in categories [key ]) {
108- detailOutput .getPrint (). line ( " - #snippet .name # - #snippet .description #" );
108+ detailOutput .output ( " - #snippet .name # - #snippet .description #" , true );
109109 }
110110 }
111111 }
112112
113- detailOutput .getPrint (). line (" " );
114- detailOutput .getPrint (). line (" " );
113+ detailOutput .line ();
114+ detailOutput .line ();
115115 detailOutput .nextSteps ([
116116 " Generate a code snippet: wheels g code <pattern-name>"
117117 ]);
@@ -122,11 +122,11 @@ component aliases="wheels g code" extends="../base" {
122122 */
123123 private function printSnippet (required struct snippet ) {
124124 detailOutput .header (" Generating Code Snippet: #arguments .snippet .name #" );
125- detailOutput .getPrint (). line (" " );
125+ detailOutput .line ();
126126
127127 var content = getSnippetContent (arguments .snippet );
128- detailOutput .getPrint (). line ( content );
129- detailOutput .getPrint (). line (" " );
128+ detailOutput .output ( " # content # " );
129+ detailOutput .line ();
130130
131131 detailOutput .success (" Code snippet '#arguments .snippet .name #' generated successfully!" );
132132 }
@@ -140,7 +140,7 @@ component aliases="wheels g code" extends="../base" {
140140
141141 if (fileExists (resolvedPath ) && ! arguments .force ) {
142142 detailOutput .error (" File already exists: #resolvedPath #" );
143- detailOutput .getPrint (). line ( " Use --force to overwrite" );
143+ detailOutput .output ( " Use --force to overwrite" , true );
144144 setExitCode (1 );
145145 return ;
146146 }
@@ -429,9 +429,9 @@ component aliases="wheels g code" extends="../base" {
429429 */
430430 private function showCustomizationOptions () {
431431 detailOutput .header (" Customization Options" );
432- detailOutput .getPrint (). line (" You can customize code snippets by:" );
433- detailOutput .getPrint (). line (" 1. Creating custom code snippets with --create" );
434- detailOutput .getPrint (). line (" 2. Saving code snippets to files with --output=file" );
435- detailOutput .getPrint (). line (" 3. Filtering by category with --category" );
432+ detailOutput .output (" You can customize code snippets by:" );
433+ detailOutput .output (" 1. Creating custom code snippets with --create" );
434+ detailOutput .output (" 2. Saving code snippets to files with --output=file" );
435+ detailOutput .output (" 3. Filtering by category with --category" );
436436 }
437437}
0 commit comments