{"record":{"id":"afbaa4bf1401eb2b","repo":"chocolatey/choco","slug":"only-a-single-package-name-can-be-passed-to-the-ch","errorCode":null,"errorMessage":"Only a single package name can be passed to the choco info command.","messagePattern":"Only a single package name can be passed to the choco info command\\.","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"src/chocolatey/infrastructure.app/commands/ChocolateyInfoCommand.cs","lineNumber":104,"sourceCode":"            configuration.Verbose = true;\r\n            configuration.ListCommand.Exact = true;\r\n        }\r\n\r\n        public override void Validate(ChocolateyConfiguration configuration)\r\n        {\r\n            base.Validate(configuration);\r\n\r\n            if (string.IsNullOrWhiteSpace(configuration.Input))\r\n            {\r\n                throw new ApplicationException(\"A single package name is required to run the choco info command.\");\r\n            }\r\n\r\n            // Validate only a single package has been passed to info\r\n            // TODO: Provide ability to get info on a list of packages. See https://github.com/chocolatey/choco/issues/2905\r\n            var input = configuration.Input.Split(' ');\r\n            if (input.Length > 1)\r\n            {\r\n                throw new ApplicationException(\"Only a single package name can be passed to the choco info command.\");\r\n            }\r\n        }\r\n\r\n        public override void HelpMessage(ChocolateyConfiguration configuration)\r\n        {\r\n            this.Log().Info(ChocolateyLoggers.Important, \"Info Command\");\r\n            this.Log().Info(@\"\r\nChocolatey will perform a search for a package local or remote and provide\r\n detailed information about that package. This is a synonym for\r\n `choco search <pkgname> --exact --detailed`.\r\n\r\n\");\r\n\r\n            \"chocolatey\".Log().Info(ChocolateyLoggers.Important, \"Usage\");\r\n            \"chocolatey\".Log().Info(@\"\r\n    choco info [<options/switches>]\r\n\");\r\n\r","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/chocolatey/choco/blob/0d5abdd10cc177a141e69547cad6935b419b6c17/src/chocolatey/infrastructure.app/commands/ChocolateyInfoCommand.cs#L86-L122","documentation":"The info command only accepts a single package name. After confirming Input is non-empty, Validate() splits on spaces and throws if more than one token is present. A TODO notes multi-package info is not yet supported.","triggerScenarios":"Running 'choco info pkgA pkgB' or 'choco info \"pkgA pkgB\"', yielding a Split(' ') length > 1.","commonSituations":"Passing a space-separated list expecting batch info; quoted multi-name strings that split into multiple tokens; copy-pasting a search query.","solutions":["Run 'choco info' separately for each package.","Use 'choco search <list> --exact --detailed' if you need broader queries.","Track multi-package info support via the referenced GitHub issue #2905."],"exampleFix":"# before\nchoco info pkgA pkgB\n\n# after\nchoco info pkgA\nchoco info pkgB","handlingStrategy":"validation","validationCode":"// info takes exactly one package.\nvar names = pkg.Split((char[])null, StringSplitOptions.RemoveEmptyEntries);\nif (names.Length != 1)\n{\n    throw new ArgumentException(\"choco info accepts a single package name\");\n}\nforeach (var n in names) RunChoco($\"info {n}\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Loop over packages calling 'choco info' once each rather than batching.","Split on whitespace to detect accidental multi-name input before invoking choco."],"tags":["info","validation","package-name","single-argument"],"backgroundTag":null,"analyzedSha":"0d5abdd10cc177a141e69547cad6935b419b6c17","analyzedAt":"2026-08-13T18:33:03.301Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}