{"record":{"id":"167356fba61b7c6e","repo":"hashicorp/vagrant","slug":"this-command-was-not-invoked-properly-the-help-fo-167356","errorCode":null,"errorMessage":"This command was not invoked properly. The help for this command is available below. %{help}","messagePattern":"This command was not invoked properly\\. The help for this command is available below\\. %(.+?)","errorType":"exception","errorClass":"Vagrant::Errors::CLIInvalidUsage","httpStatus":null,"severity":"error","filePath":"plugins/commands/cloud/list.rb","lineNumber":41,"sourceCode":"            o.on(\"-j\", \"--json\", \"Formats results in JSON\") do |j|\n              options[:check] = j\n            end\n            o.on(\"-l\", \"--limit\", Integer, \"Max number of search results (default is 25)\") do |l|\n              options[:check] = l\n            end\n            o.on(\"-p\", \"--provider\", \"Comma separated list of providers to filter search. Defaults to all.\") do |p|\n              options[:check] = p\n            end\n            o.on(\"-s\", \"--sort-by\", \"Column to sort list (created, downloads, updated)\") do |s|\n              options[:check] = s\n            end\n          end\n\n          # Parse the options\n          argv = parse_options(opts)\n          return if !argv\n          if argv.length > 1\n            raise Vagrant::Errors::CLIInvalidUsage,\n              help: opts.help.chomp\n          end\n\n          @client = client_login(@env)\n\n          # TODO: This endpoint is not implemented yet\n\n          0\n        end\n      end\n    end\n  end\nend\n","sourceCodeStart":23,"sourceCodeEnd":55,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/commands/cloud/list.rb#L23-L55","documentation":"`vagrant cloud list` raises CLIInvalidUsage when given more than one positional argument; it accepts at most one (an optional query string). Note that in this version the backing endpoint is still a TODO — after login the command simply returns 0 — so the usage guard is the only substantive behavior beyond option parsing.","triggerScenarios":"Running `vagrant cloud list foo bar`; an unquoted multi-word string splitting into two argv entries; forwarding arbitrary user input as multiple arguments from a wrapper.","commonSituations":"Treating list like search and passing an unquoted query; expecting provider filtering via positional args instead of the -p/--provider and -s/--sort-by flags; scripts passing \"$@\" where users type multiple words.","solutions":["Pass at most one argument, quoted: `vagrant cloud list \"my boxes\"`","Use the documented flags (-p, -s) for filtering instead of extra positionals","Use `vagrant cloud search \"query\"` for working remote queries, since list's endpoint is unimplemented in this version"],"exampleFix":"# before\nvagrant cloud list ubuntu server\n# after\nvagrant cloud list \"ubuntu server\"","handlingStrategy":"validation","validationCode":"# bash: at most one positional before invoking\nif [ \"$#\" -gt 1 ]; then\n  echo \"usage: vagrant cloud list [query]\" >&2\n  exit 64\nfi\nexec vagrant cloud list \"$@\"","typeGuard":null,"tryCatchPattern":"begin\n  env.cli(%w[cloud list], query)\nrescue Vagrant::Errors::CLIInvalidUsage => e\n  $stderr.puts e.message.lines.first\n  exit 64\nend","preventionTips":["Quote multi-word queries when invoking list","Prefer `vagrant cloud search` for real queries — list's endpoint is a TODO in this version","Do not build automation on `cloud list` until the endpoint is implemented"],"tags":["vagrant","vagrant-cloud","cli","argument-validation"],"backgroundTag":"cli-invalid-usage","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}