{"record":{"id":"575e71ca029eebf0","repo":"chocolatey/choco","slug":"a-single-package-name-is-required-to-run-the-choco","errorCode":null,"errorMessage":"A single package name is required to run the choco info command.","messagePattern":"A single package name is required to run the choco info command\\.","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"src/chocolatey/infrastructure.app/commands/ChocolateyInfoCommand.cs","lineNumber":96,"sourceCode":"                    \"Include Configured Sources - When using the '--source' option, this appends the sources that have been saved into the chocolatey.config file by 'source' command.  Available in 2.3.0+\",\r\n                    option => configuration.IncludeConfiguredSources = option != null)\r\n                ;\r\n        }\r\n\r\n        public override void ParseAdditionalArguments(IList<string> unparsedArguments, ChocolateyConfiguration configuration)\r\n        {\r\n            configuration.Input = string.Join(\" \", unparsedArguments);\r\n            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","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/chocolatey/choco/blob/0d5abdd10cc177a141e69547cad6935b419b6c17/src/chocolatey/infrastructure.app/commands/ChocolateyInfoCommand.cs#L78-L114","documentation":"The info command (a synonym for 'choco search <pkg> --exact --detailed') requires exactly one package name. Validate() throws if configuration.Input is blank, because there is nothing to look up.","triggerScenarios":"Running 'choco info' with no package name argument at all.","commonSituations":"Running a bare 'choco info'; scripting that builds the command without a package variable; a variable expanding to empty.","solutions":["Supply a package name: 'choco info <pkg>'.","In scripts, guard the call so it only runs when the package variable is non-empty.","Use 'choco search' if you want optional/empty queries."],"exampleFix":"# before\nchoco info\n\n# after\nchoco info chocolatey","handlingStrategy":"validation","validationCode":"// Ensure a package name before calling info.\nif (string.IsNullOrWhiteSpace(pkg))\n{\n    throw new InvalidOperationException(\"choco info requires a package name\");\n}\nRunChoco($\"info {pkg}\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Assert the package variable is non-empty in scripts.","Use 'choco search' for optional/empty queries instead of info."],"tags":["info","validation","package-name"],"backgroundTag":null,"analyzedSha":"0d5abdd10cc177a141e69547cad6935b419b6c17","analyzedAt":"2026-08-13T18:33:03.301Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}