{"record":{"id":"a65d39851d025948","repo":"Devolutions/UniGetUI","slug":"the-value-supplied-to-enabled-must-be-either-tru","errorCode":null,"errorMessage":"The value supplied to --enabled must be either true or false.","messagePattern":"The value supplied to --enabled must be either true or false\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/UniGetUI.Interface.IpcApi/IpcCliCommandRunner.cs","lineNumber":729,"sourceCode":"    {\n        return new IpcBundleInstallRequest\n        {\n            IncludeInstalled = GetOptionalBoolArgument(args, \"--include-installed\"),\n            Elevated = GetOptionalBoolArgument(args, \"--elevated\"),\n            Interactive = GetOptionalBoolArgument(args, \"--interactive\"),\n            SkipHash = GetOptionalBoolArgument(args, \"--skip-hash\"),\n        };\n    }\n\n    private static IpcSettingValueRequest BuildSettingRequest(IReadOnlyList<string> args)\n    {\n        bool? enabled = null;\n        string? enabledValue = GetOptionalArgument(args, \"--enabled\");\n        if (enabledValue is not null)\n        {\n            if (!bool.TryParse(enabledValue, out bool parsedEnabled))\n            {\n                throw new InvalidOperationException(\n                    \"The value supplied to --enabled must be either true or false.\"\n                );\n            }\n\n            enabled = parsedEnabled;\n        }\n\n        return new IpcSettingValueRequest\n        {\n            SettingKey = GetRequiredArgument(\n                args,\n                \"--key\",\n                \"This command requires --key.\"\n            ),\n            Enabled = enabled,\n            Value = GetOptionalArgument(args, \"--value\"),\n        };\n    }","sourceCodeStart":711,"sourceCodeEnd":747,"githubUrl":"https://github.com/Devolutions/UniGetUI/blob/9b1d7d0eab91620fc15c86b36676532095936ae3/src/UniGetUI.Interface.IpcApi/IpcCliCommandRunner.cs#L711-L747","documentation":"Thrown by IpcCliCommandRunner.BuildSettingRequest when the '--enabled' flag value cannot be parsed by bool.TryParse. This is specific to the set-setting CLI path, which accepts only .NET bool tokens (True/False case-insensitive, and '1'/'0' are NOT accepted by bool.TryParse).","triggerScenarios":"Running 'unigetui set-setting --key X --enabled yes', '--enabled 1', '--enabled on', or '--enabled enable'. bool.TryParse only accepts 'True'/'False' (any case) and null.","commonSituations":"Shell users passing 1/0 or yes/no, common in other CLIs. Copying a value from a YAML/config that uses 'on'. Locale-influenced booleans.","solutions":["Pass '--enabled true' or '--enabled false' (case-insensitive).","Note that '1'/'0'/'yes'/'on' are rejected; spell the word out.","Omit --enabled entirely if you only want to set a string --value."],"exampleFix":"// before\nunigetui set-setting --key AutoCheckUpdates --enabled 1\n// after\nunigetui set-setting --key AutoCheckUpdates --enabled true","handlingStrategy":"validation","validationCode":"static bool TryNormalizeEnabled(string? raw, out bool value) =>\n    bool.TryParse(raw, out value);\n\n// reject '1/0/yes/no' explicitly in the UI before calling set-setting.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a boolean toggle in the UI, not free text, for --enabled.","Document that only 'true'/'false' are accepted (no 1/0/yes/no)."],"tags":["ipc","cli","settings","input-validation","boolean"],"backgroundTag":null,"analyzedSha":"9b1d7d0eab91620fc15c86b36676532095936ae3","analyzedAt":"2026-08-13T12:19:18.278Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}