{"record":{"id":"410ece1afd264714","repo":"hashicorp/vagrant","slug":"this-command-was-not-invoked-properly-the-help-fo-410ece","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/version/delete.rb","lineNumber":32,"sourceCode":"            options = {}\n\n            opts = OptionParser.new do |o|\n              o.banner = \"Usage: vagrant cloud version delete [options] organization/box-name version\"\n              o.separator \"\"\n              o.separator \"Deletes a version entry on Vagrant Cloud\"\n              o.separator \"\"\n              o.separator \"Options:\"\n              o.separator \"\"\n              o.on(\"-f\", \"--[no-]force\", \"Force deletion without confirmation\") do |f|\n                options[:force] = f\n              end\n            end\n\n            # Parse the options\n            argv = parse_options(opts)\n            return if !argv\n            if argv.size != 2\n              raise Vagrant::Errors::CLIInvalidUsage,\n                help: opts.help.chomp\n            end\n\n            org, box_name = argv.first.split('/', 2)\n            version = argv[1]\n\n            if !options[:force]\n              @env.ui.warn(I18n.t(\"cloud_command.version.delete_warn\", version: version, box: argv.first))\n              cont = @env.ui.ask(I18n.t(\"cloud_command.continue\"))\n              return 1 if cont.strip.downcase != \"y\"\n            end\n\n            @client = client_login(@env)\n\n            delete_version(org, box_name, version, @client.token, options.slice)\n          end\n\n          # Delete the requested box version","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/commands/cloud/version/delete.rb#L14-L50","documentation":"`vagrant cloud version delete` requires exactly two positional arguments: the `org/box-name` identifier and the version to delete. `argv.size != 2` raises CLIInvalidUsage for any other count; the -f/--force flag (which skips the y/N confirmation) is an option and does not count toward the two.","triggerScenarios":"`vagrant cloud version delete myorg/mybox` (version missing); three or more arguments from splitting or extra junk; passing the confirmation answer as a positional.","commonSituations":"Scripts building the command from variables where the version is sometimes empty; unquoted identifiers or versions containing spaces; expecting the confirmation reply to be an argument.","solutions":["Use the exact form: `vagrant cloud version delete org/box-name version`","Add -f to skip the prompt in automation: `vagrant cloud version delete -f myorg/mybox 1.0.0`","Validate the version exists first with `vagrant cloud version list` style inspection or `vagrant cloud box show`"],"exampleFix":"# before\nvagrant cloud version delete myorg/mybox\n# after\nvagrant cloud version delete -f myorg/mybox 1.0.0","handlingStrategy":"validation","validationCode":"# bash: exactly two arguments, first slash-separated, second non-empty\nif [ \"$#\" -ne 2 ] || ! [[ \"$1\" == */* ]] || [ -z \"$2\" ]; then\n  echo \"usage: vagrant cloud version delete [-f] org/box-name version\" >&2\n  exit 64\nfi\nexec vagrant cloud version delete \"$@\"","typeGuard":null,"tryCatchPattern":"begin\n  env.cli(%w[cloud version delete], org_box, version)\nrescue Vagrant::Errors::CLIInvalidUsage => e\n  $stderr.puts e.message.lines.first\n  exit 64\nend","preventionTips":["Guard against empty version variables before building the command","Pass -f in automation so the confirmation prompt cannot hang a pipeline","Quote both arguments — split tokens change the argument count and hit this error"],"tags":["vagrant","vagrant-cloud","cli","argument-validation","version-management"],"backgroundTag":"cli-invalid-usage","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}