{"record":{"id":"b31c9eb6da00b674","repo":"chocolatey/choco","slug":"a-single-feature-command-must-be-listed-please-se","errorCode":null,"errorMessage":"A single feature command must be listed. Please see the help menu for those commands.","messagePattern":"A single feature command must be listed\\. Please see the help menu for those commands\\.","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"src/chocolatey/infrastructure.app/commands/ChocolateyFeatureCommand.cs","lineNumber":77,"sourceCode":"            Enum.TryParse(unparsedCommand, true, out command);\r\n            if (command == FeatureCommandType.Unknown)\r\n            {\r\n                if (!string.IsNullOrWhiteSpace(unparsedCommand))\r\n                {\r\n                    this.Log().Warn(\"Unknown command {0}. Setting to list.\".FormatWith(unparsedCommand));\r\n                }\r\n\r\n                command = FeatureCommandType.List;\r\n            }\r\n\r\n            configuration.FeatureCommand.Command = command;\r\n\r\n            if ((configuration.FeatureCommand.Command == FeatureCommandType.List\r\n                 || !string.IsNullOrWhiteSpace(configuration.FeatureCommand.Name)\r\n                )\r\n                && unparsedArguments.Count > 1)\r\n            {\r\n                throw new ApplicationException(\"A single feature command must be listed. Please see the help menu for those commands.\");\r\n            }\r\n\r\n            if (string.IsNullOrWhiteSpace(configuration.FeatureCommand.Name) && unparsedArguments.Count >= 2)\r\n            {\r\n                configuration.FeatureCommand.Name = unparsedArguments[1];\r\n            }\r\n        }\r\n\r\n        public virtual void Validate(ChocolateyConfiguration configuration)\r\n        {\r\n            if (configuration.FeatureCommand.Command != FeatureCommandType.List && string.IsNullOrWhiteSpace(configuration.FeatureCommand.Name))\r\n            {\r\n                throw new ApplicationException(\"When specifying the subcommand '{0}', you must also specify --name.\".FormatWith(configuration.FeatureCommand.Command.ToStringSafe().ToLower()));\r\n            }\r\n        }\r\n\r\n        public virtual void HelpMessage(ChocolateyConfiguration configuration)\r\n        {\r","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/chocolatey/choco/blob/0d5abdd10cc177a141e69547cad6935b419b6c17/src/chocolatey/infrastructure.app/commands/ChocolateyFeatureCommand.cs#L59-L95","documentation":"The feature command allows a single positional subcommand/argument. ParseAdditionalArguments throws when unparsedArguments.Count > 1 while the command is List or a name was already resolved, because multiple leftover positional tokens are ambiguous. It points to the help menu for valid feature commands (list/enable/disable).","triggerScenarios":"Running 'choco feature enable extra', 'choco feature disable name extra', or any feature invocation leaving more than one unparsed positional token.","commonSituations":"Passing multiple feature names; scripting that concatenates arguments; stray positional tokens from misquoted strings.","solutions":["Pass a single feature subcommand with one --name: 'choco feature enable -n <feature>'.","Enable/disable features one at a time rather than batching.","Run 'choco feature -?' to confirm the supported subcommands."],"exampleFix":"# before\nchoco feature enable -n useFipsCompliantChecksums -n allowGlobalConfirmation\n\n# after\nchoco feature enable -n useFipsCompliantChecksums\nchoco feature enable -n allowGlobalConfirmation","handlingStrategy":"validation","validationCode":"// Feature command: single positional argument max.\nvar positional = tokens.Where(t => !t.StartsWith(\"-\")).ToList();\nif (positional.Count > 1)\n{\n    throw new ArgumentException(\"feature: too many positional arguments\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Toggle one feature per invocation.","Use 'choco feature list' to enumerate feature names."],"tags":["feature","arguments","cli","validation"],"backgroundTag":null,"analyzedSha":"0d5abdd10cc177a141e69547cad6935b419b6c17","analyzedAt":"2026-08-13T18:33:03.301Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}