{"record":{"id":"ffab006126862263","repo":"BCUninstaller/Bulk-Crap-Uninstaller","slug":"no-commands-specified-ffab00","errorCode":null,"errorMessage":"No commands specified","messagePattern":"No commands specified","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"warning","filePath":"source/WinUpdateHelper/Program.cs","lineNumber":99,"sourceCode":"\r\n                    case @\"l\":\r\n                    case @\"list\":\r\n                        if (_queryType != QueryType.None) throw new ArgumentException(@\"Multiple commands specified\");\r\n                        _queryType = QueryType.List;\r\n                        break;\r\n\r\n                    default:\r\n                        if (_queryType != QueryType.Uninstall)\r\n                            throw new ArgumentException($@\"Unknown argument: {arg}\");\r\n                        if (_updateId != null)\r\n                            throw new ArgumentException(@\"Multiple UpdateIDs specified\");\r\n                        _updateId = arg;\r\n                        break;\r\n                }\r\n            }\r\n\r\n            if (_queryType == QueryType.None)\r\n                throw new ArgumentException(@\"No commands specified\");\r\n\r\n            if (_queryType == QueryType.Uninstall && _updateId == null)\r\n                throw new ArgumentException(@\"No UpdateID specified\");\r\n        }\r\n\r\n        private enum QueryType\r\n        {\r\n            None,\r\n            Uninstall,\r\n            List\r\n        }\r\n    }\r\n}","sourceCodeStart":81,"sourceCodeEnd":112,"githubUrl":"https://github.com/BCUninstaller/Bulk-Crap-Uninstaller/blob/608321de98e92297377b1eb69029af55c25504a1/source/WinUpdateHelper/Program.cs#L81-L112","documentation":"ArgumentException thrown after the argument loop if _queryType is still None, meaning no command token (u/uninstall or l/list) was provided at all. The tool requires a command to know what to do.","triggerScenarios":"Running the executable with no args, or with only an UpdateID and no command, or with only unrecognized tokens that never set _queryType.","commonSituations":"Bare 'WinUpdateHelper.exe' with no arguments. Passing only an ID because the user assumed positional semantics. A wrapper that strips args in error and launches with an empty array.","solutions":["Always include a command: 'list' or 'uninstall <UpdateID>'.","If calling programmatically, assert the argument array is non-empty and contains a command before launching.","Add a usage/help printout when args.Length==0 to guide users."],"exampleFix":"// before\nWinUpdateHelper.exe\n// after\nWinUpdateHelper.exe list","handlingStrategy":"validation","validationCode":"if (!args.Any()) throw new ArgumentException(\"No commands specified\");","typeGuard":"bool HasCommand(IEnumerable<string> args) =>\n    args.Any(a => new[]{\"u\",\"uninstall\",\"l\",\"list\"}.Contains(a.ToLowerInvariant()));","tryCatchPattern":null,"preventionTips":["Always include a command token.","In a wrapper, assert the arg array is non-empty and contains a command.","Print usage guidance when args.Length==0."],"tags":["cli","argument-validation","windows-update","wu"],"backgroundTag":null,"analyzedSha":"608321de98e92297377b1eb69029af55c25504a1","analyzedAt":"2026-08-13T12:17:35.389Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}