{"record":{"id":"d3a199e61d2b1853","repo":"BCUninstaller/Bulk-Crap-Uninstaller","slug":"no-commands-specified","errorCode":null,"errorMessage":"No commands specified","messagePattern":"No commands specified","errorType":"exception","errorClass":"FormatException","httpStatus":null,"severity":"error","filePath":"source/ScriptHelper/Program.cs","lineNumber":91,"sourceCode":"                        if (_queryType != QueryType.None) throw new FormatException(@\"Multiple commands specified\");\n                        _queryType = QueryType.Uninstall;\n                        break;\n\n                    case @\"l\":\n                    case @\"list\":\n                        if (_queryType != QueryType.None) throw new FormatException(@\"Multiple commands specified\");\n                        _queryType = QueryType.List;\n                        break;\n\n                    default:\n                        if (_appId != null) throw new FormatException(@\"Too many parameters\");\n                        _appId = arg;\n                        break;\n                }\n            }\n\n            if (_queryType == QueryType.None)\n                throw new FormatException(@\"No commands specified\");\n            if (_queryType == QueryType.Uninstall && _appId == null)\n                throw new FormatException(@\"Missing ID parameter for what to uninstall\");\n        }\n\n        private enum QueryType\n        {\n            None,\n            Uninstall,\n            List,\n        }\n    }\n}","sourceCodeStart":73,"sourceCodeEnd":103,"githubUrl":"https://github.com/BCUninstaller/Bulk-Crap-Uninstaller/blob/608321de98e92297377b1eb69029af55c25504a1/source/ScriptHelper/Program.cs#L73-L103","documentation":"A FormatException raised after the ScriptHelper argument loop completes when `_queryType` is still `QueryType.None`. It means none of the recognized command tokens (uninstall, l, list) was present, so there is nothing for the helper to do. The check exists to fail explicitly rather than silently no-op.","triggerScenarios":"Running `ScriptHelper <appId>` with an app identifier but no command, or `ScriptHelper` with no arguments at all, or passing only unrecognized tokens that all fall into the default case.","commonSituations":"Caller scripts that prepend the app ID but forget the verb; typos like `unintall`; environment where the command token was stripped by a wrapper.","solutions":["Always include a command token: `ScriptHelper uninstall <id>` or `ScriptHelper list`.","Check for supported command names before assembling the command line.","Add a usage/help check in the calling script when no command is supplied."],"exampleFix":"// before\nScriptHelper 123\n// after\nScriptHelper uninstall 123","handlingStrategy":"validation","validationCode":"var commands = new[] { \"uninstall\", \"list\", \"l\" };\nif (!args.Any(a => commands.Contains(a, StringComparer.OrdinalIgnoreCase)))\n    throw new ArgumentException(\"No command specified. Use uninstall or list.\");","typeGuard":null,"tryCatchPattern":"try { /* invoke ScriptHelper */ }\ncatch (FormatException ex) when (ex.Message.Contains(\"No commands specified\"))\n{ /* prompt user for a command and retry */ }","preventionTips":["Always specify a command token when invoking ScriptHelper.","Default to a command in wrapper scripts when none is given.","Validate presence of a command verb before exec."],"tags":["cli","argument-parsing","scripthelper"],"backgroundTag":null,"analyzedSha":"608321de98e92297377b1eb69029af55c25504a1","analyzedAt":"2026-08-13T12:17:35.389Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}