diff --git a/cli/src/commands/wheels/analyze/code.cfc b/cli/src/commands/wheels/analyze/code.cfc index 738314996..d47368b41 100644 --- a/cli/src/commands/wheels/analyze/code.cfc +++ b/cli/src/commands/wheels/analyze/code.cfc @@ -180,6 +180,7 @@ component extends="../base" { // Display issues by file if (structCount(results.files) > 0) { detailOutput.subHeader("Issues by File"); + var filteredSeverity = lcase(arguments.severity); for (var filePath in results.files) { var fileIssues = results.files[filePath]; var relativePath = replace(filePath, getCWD(), ""); @@ -189,15 +190,13 @@ component extends="../base" { // Group issues by severity for better readability var groupedIssues = groupIssuesBySeverity(fileIssues); - for (var severity in ["error", "warning", "info"]) { - if (structKeyExists(groupedIssues, severity) && arrayLen(groupedIssues[severity]) > 0) { - for (var issue in groupedIssues[severity]) { - var icon = getSeverityIcon(issue.severity); - var color = getSeverityColor(issue.severity); + if (structKeyExists(groupedIssues, filteredSeverity) && arrayLen(groupedIssues[filteredSeverity]) > 0) { + for (var issue in groupedIssues[filteredSeverity]) { + var icon = getSeverityIcon(issue.severity); + var color = getSeverityColor(issue.severity); - detailOutput.output("#icon# Line #issue.line#:#issue.column# - #issue.message#", true); - print.cyanLine(" Rule: #issue.rule#" & (issue.fixable ? " [Auto-fixable]" : "")).toConsole(); - } + detailOutput.output("#icon# Line #issue.line#:#issue.column# - #issue.message#", true); + print.cyanLine(" Rule: #issue.rule#" & (issue.fixable ? " [Auto-fixable]" : "")).toConsole(); } } diff --git a/cli/src/commands/wheels/config/dump.cfc b/cli/src/commands/wheels/config/dump.cfc index f72b33935..262435e7f 100644 --- a/cli/src/commands/wheels/config/dump.cfc +++ b/cli/src/commands/wheels/config/dump.cfc @@ -88,7 +88,7 @@ component extends="commandbox.modules.wheels-cli.commands.wheels.base" { // Output to console if not table format if(arguments.format == "json"){ detailOutput.line(); - detailOutput.output(deserializeJSON(local.outputContent)); + detailOutput.getPrint().line(deserializeJSON(local.outputContent)).toConsole(); } else { detailOutput.line(); detailOutput.output(local.outputContent); diff --git a/cli/src/commands/wheels/generate/code.cfc b/cli/src/commands/wheels/generate/code.cfc index 04982a6f5..a5ac0bd62 100644 --- a/cli/src/commands/wheels/generate/code.cfc +++ b/cli/src/commands/wheels/generate/code.cfc @@ -21,7 +21,7 @@ component aliases="wheels g code" extends="../base" { * @force.hint Overwrite existing files */ function run( - required string pattern, + string pattern, boolean list = false, string category = "", string output = "console", @@ -53,8 +53,8 @@ component aliases="wheels g code" extends="../base" { if (!len(arguments.pattern)) { detailOutput.error("Pattern name is required"); - detailOutput.getPrint().line("Usage: wheels g code "); - detailOutput.getPrint().line("Run 'wheels g code --list' to see available patterns"); + detailOutput.output("Usage: wheels g code ", true); + detailOutput.output("Run 'wheels g code --list' to see available patterns", true); setExitCode(1); return; } @@ -62,7 +62,7 @@ component aliases="wheels g code" extends="../base" { var snippet = getSnippetByName(arguments.pattern); if (!structCount(snippet)) { detailOutput.error("Code snippet '#arguments.pattern#' not found"); - detailOutput.getPrint().line("Run 'wheels g code --list' to see available patterns"); + detailOutput.output("Run 'wheels g code --list' to see available patterns", true); setExitCode(1); return; } @@ -102,16 +102,16 @@ component aliases="wheels g code" extends="../base" { for (var cat in categoryOrder) { var key = lCase(cat); if (structKeyExists(categories, key)) { - detailOutput.getPrint().line(""); - detailOutput.getPrint().boldLine("#cat#:"); + detailOutput.line(); + detailOutput.getPrint().boldLine("#cat#:").toConsole(); for (var snippet in categories[key]) { - detailOutput.getPrint().line(" - #snippet.name# - #snippet.description#"); + detailOutput.output(" - #snippet.name# - #snippet.description#", true); } } } - detailOutput.getPrint().line(""); - detailOutput.getPrint().line(""); + detailOutput.line(); + detailOutput.line(); detailOutput.nextSteps([ "Generate a code snippet: wheels g code " ]); @@ -122,11 +122,11 @@ component aliases="wheels g code" extends="../base" { */ private function printSnippet(required struct snippet) { detailOutput.header("Generating Code Snippet: #arguments.snippet.name#"); - detailOutput.getPrint().line(""); + detailOutput.line(); var content = getSnippetContent(arguments.snippet); - detailOutput.getPrint().line(content); - detailOutput.getPrint().line(""); + detailOutput.output("#content#"); + detailOutput.line(); detailOutput.success("Code snippet '#arguments.snippet.name#' generated successfully!"); } @@ -140,7 +140,7 @@ component aliases="wheels g code" extends="../base" { if (fileExists(resolvedPath) && !arguments.force) { detailOutput.error("File already exists: #resolvedPath#"); - detailOutput.getPrint().line("Use --force to overwrite"); + detailOutput.output("Use --force to overwrite", true); setExitCode(1); return; } @@ -429,9 +429,9 @@ component aliases="wheels g code" extends="../base" { */ private function showCustomizationOptions() { detailOutput.header("Customization Options"); - detailOutput.getPrint().line("You can customize code snippets by:"); - detailOutput.getPrint().line(" 1. Creating custom code snippets with --create"); - detailOutput.getPrint().line(" 2. Saving code snippets to files with --output=file"); - detailOutput.getPrint().line(" 3. Filtering by category with --category"); + detailOutput.output("You can customize code snippets by:"); + detailOutput.output(" 1. Creating custom code snippets with --create"); + detailOutput.output(" 2. Saving code snippets to files with --output=file"); + detailOutput.output(" 3. Filtering by category with --category"); } } diff --git a/cli/src/commands/wheels/generate/scaffold.cfc b/cli/src/commands/wheels/generate/scaffold.cfc index 66038b655..10312875b 100644 --- a/cli/src/commands/wheels/generate/scaffold.cfc +++ b/cli/src/commands/wheels/generate/scaffold.cfc @@ -101,13 +101,13 @@ component aliases="wheels g scaffold, wheels g resource, wheels generate resourc // Run migrations if requested if (arguments.migrate) { detailOutput.invoke("dbmigrate"); - command('wheels dbmigrate up').run(); + command('wheels dbmigrate latest').run(); } else if (!arguments.api) { // Only ask to migrate in interactive mode try { if (confirm("Would you like to run migrations now? [y/n]")) { detailOutput.invoke("dbmigrate"); - command('wheels dbmigrate up').run(); + command('wheels dbmigrate latest').run(); } } catch (any e) { // Skip if non-interactive diff --git a/cli/src/commands/wheels/get/settings.cfc b/cli/src/commands/wheels/get/settings.cfc index 0378a7034..ece7af5ed 100644 --- a/cli/src/commands/wheels/get/settings.cfc +++ b/cli/src/commands/wheels/get/settings.cfc @@ -207,39 +207,35 @@ component extends="../base" { private void function parseSettings(required string content, required struct settings) { // Parse set() calls in the settings file - local.pattern = 'set\s*\(\s*([^=]+)\s*=\s*([^)]+)\)'; + local.pattern = 'set\s*\(\s*([^=\s]+(?:\s*[^=\s]*)*)\s*=\s*([^)]+)\)'; local.matches = REMatchNoCase(local.pattern, arguments.content); for (local.match in local.matches) { try { // Extract key and value - local.parts = REFind(local.pattern, local.match, 1, true); + local.extractPattern = 'set\s*\(\s*([^=]+?)\s*=\s*([^)]+)\)'; + local.parts = REFindNoCase(local.extractPattern, local.match, 1, true); + if (local.parts.pos[1] > 0) { - local.assignment = Mid(local.match, local.parts.pos[2], local.parts.len[2]); - local.assignParts = ListToArray(local.assignment, "="); - if (ArrayLen(local.assignParts) >= 2) { - local.key = Trim(local.assignParts[1]); - // Join remaining parts with = in case value contains = - local.valueParts = []; - for (local.i = 2; local.i <= ArrayLen(local.assignParts); local.i++) { - ArrayAppend(local.valueParts, local.assignParts[local.i]); - } - local.value = Trim(ArrayToList(local.valueParts, "=")); - - // Clean up the value - local.value = REReplace(local.value, "^['""]|['""]$", "", "all"); - - // Try to parse boolean/numeric values - if (local.value == "true") { - local.value = true; - } else if (local.value == "false") { - local.value = false; - } else if (IsNumeric(local.value)) { - local.value = Val(local.value); - } - - arguments.settings[local.key] = local.value; + // Extract key (trim whitespace) + local.key = Trim(Mid(local.match, local.parts.pos[2], local.parts.len[2])); + + // Extract value (trim whitespace) + local.value = Trim(Mid(local.match, local.parts.pos[3], local.parts.len[3])); + + // Clean up quotes from the value + local.value = REReplace(local.value, "^['""]|['""]$", "", "all"); + + // Try to parse boolean/numeric values + if (local.value == "true") { + local.value = true; + } else if (local.value == "false") { + local.value = false; + } else if (IsNumeric(local.value)) { + local.value = Val(local.value); } + + arguments.settings[local.key] = local.value; } } catch (any e) { // Skip malformed settings diff --git a/cli/src/commands/wheels/plugins/list.cfc b/cli/src/commands/wheels/plugins/list.cfc index 953bd9264..b5ec92ca6 100644 --- a/cli/src/commands/wheels/plugins/list.cfc +++ b/cli/src/commands/wheels/plugins/list.cfc @@ -87,7 +87,7 @@ component aliases="wheels plugin list" extends="../base" { } // Display the table - detailOutput.getPrint().table(rows); + detailOutput.getPrint().table(rows).toConsole(); detailOutput.line(); detailOutput.divider("-", 60); diff --git a/cli/src/commands/wheels/plugins/outdated.cfc b/cli/src/commands/wheels/plugins/outdated.cfc index d91e7d92f..f60f10c6b 100644 --- a/cli/src/commands/wheels/plugins/outdated.cfc +++ b/cli/src/commands/wheels/plugins/outdated.cfc @@ -130,7 +130,7 @@ component aliases="wheels plugin outdated,wheels plugins outdated" extends="../b } // Display the table - print.table(rows); + print.table(rows).toConsole(); detailOutput.line(); detailOutput.divider("-", 60); diff --git a/cli/src/commands/wheels/plugins/search.cfc b/cli/src/commands/wheels/plugins/search.cfc index a2f6066b9..56b04a685 100644 --- a/cli/src/commands/wheels/plugins/search.cfc +++ b/cli/src/commands/wheels/plugins/search.cfc @@ -170,7 +170,7 @@ component aliases="wheels plugin search" extends="../base" { // Display the table - detailOutput.getPrint().table(rows); + detailOutput.getPrint().table(rows).toConsole(); detailOutput.line(); detailOutput.divider(); diff --git a/cli/src/commands/wheels/plugins/update.cfc b/cli/src/commands/wheels/plugins/update.cfc index 2a12eac6e..a890505a2 100644 --- a/cli/src/commands/wheels/plugins/update.cfc +++ b/cli/src/commands/wheels/plugins/update.cfc @@ -196,7 +196,7 @@ component aliases="wheels plugin update" extends="../base" { // Show version comparison detailOutput.subHeader("Update Summary"); detailOutput.metric("Plugin", pluginInfo.name); - detailOutput.update("Version", "v#currentVersion# → v#targetVersion#"); + detailOutput.metric("Version", "v#currentVersion# → v#targetVersion#"); detailOutput.metric("Location", "/plugins/#foundPlugin.folderName#"); detailOutput.line(); diff --git a/cli/src/commands/wheels/plugins/updateAll.cfc b/cli/src/commands/wheels/plugins/updateAll.cfc index abac4c946..92175b587 100644 --- a/cli/src/commands/wheels/plugins/updateAll.cfc +++ b/cli/src/commands/wheels/plugins/updateAll.cfc @@ -4,7 +4,7 @@ * wheels plugin update:all * wheels plugin update:all --dryRun */ -component aliases="wheels plugin update:all,wheels plugins update:all" extends="../base" { +component aliases="wheels plugin update:all,wheels plugins update:all, wheels plugin updateall" extends="../base" { property name="pluginService" inject="PluginService@wheels-cli"; property name="packageService" inject="PackageService"; @@ -122,7 +122,7 @@ component aliases="wheels plugin update:all,wheels plugins update:all" extends=" }); } - print.table(updateRows); + print.table(updateRows).toConsole(); detailOutput.line(); if (arguments.dryRun) { @@ -198,7 +198,6 @@ component aliases="wheels plugin update:all,wheels plugins update:all" extends=" // Show final summary detailOutput.line(); - detailOutput.divider("=", 60); detailOutput.header("Update Summary"); detailOutput.line(); @@ -214,7 +213,7 @@ component aliases="wheels plugin update:all,wheels plugins update:all" extends=" arrayAppend(summaryRows, { "Status" = "Check errors", "Count" = "#arrayLen(errors)#" }); } - print.table(summaryRows); + print.table(summaryRows).toConsole(); detailOutput.line(); if (successCount > 0) { diff --git a/docs/src/command-line-tools/commands/test/test-run.md b/docs/src/command-line-tools/commands/test/test-run.md index b48a425e0..60c541380 100644 --- a/docs/src/command-line-tools/commands/test/test-run.md +++ b/docs/src/command-line-tools/commands/test/test-run.md @@ -454,7 +454,4 @@ box server restart ## See Also -- [wheels test](test.md) - Run framework tests -- [wheels test coverage](test-coverage.md) - Generate coverage -- [wheels test debug](test-debug.md) - Debug tests - [wheels generate test](../generate/test.md) - Generate test files \ No newline at end of file