{"record":{"id":"93855638768f28a7","repo":"BCUninstaller/Bulk-Crap-Uninstaller","slug":"missing-id-parameter-for-what-to-uninstall","errorCode":null,"errorMessage":"Missing ID parameter for what to uninstall","messagePattern":"Missing ID parameter for what to uninstall","errorType":"exception","errorClass":"FormatException","httpStatus":null,"severity":"error","filePath":"source/ScriptHelper/Program.cs","lineNumber":93,"sourceCode":"                        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":75,"sourceCodeEnd":103,"githubUrl":"https://github.com/BCUninstaller/Bulk-Crap-Uninstaller/blob/608321de98e92297377b1eb69029af55c25504a1/source/ScriptHelper/Program.cs#L75-L103","documentation":"A FormatException raised after parsing when `_queryType == QueryType.Uninstall` but `_appId` is still null. Uninstall requires a target identifier; without it the operation is ambiguous and is rejected before any uninstall logic runs.","triggerScenarios":"Running `ScriptHelper uninstall` with no positional app identifier following the command token.","commonSituations":"Caller script that builds the uninstall command from a variable that was empty/null; forgetting to append the id after the verb.","solutions":["Supply the app identifier after the uninstall command: `ScriptHelper uninstall <id>`.","Check that the id variable is non-empty in the calling script before invoking.","Fall back to `ScriptHelper list` first to obtain the correct id."],"exampleFix":"// before\nScriptHelper uninstall\n// after\nScriptHelper uninstall 123","handlingStrategy":"validation","validationCode":"if (command == \"uninstall\" && string.IsNullOrWhiteSpace(appId))\n    throw new ArgumentException(\"Uninstall requires an app id.\");","typeGuard":null,"tryCatchPattern":"try { /* invoke ScriptHelper uninstall */ }\ncatch (FormatException ex) when (ex.Message.Contains(\"Missing ID\"))\n{ /* resolve the id first (e.g. via list) then retry */ }","preventionTips":["Resolve and verify the app id before issuing an uninstall.","Use `list` to discover ids when the target is unknown.","Fail the caller early when the id variable is empty."],"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"}