{"record":{"id":"da91c387d0702c6b","repo":"hashicorp/vagrant","slug":"this-command-was-not-invoked-properly-the-help-fo-da91c3","errorCode":null,"errorMessage":"This command was not invoked properly. The help for this command is\navailable below.\n\n%{help}","messagePattern":"This command was not invoked properly\\. The help for this command is\navailable below\\.\n\n%(.+?)","errorType":"exception","errorClass":"Vagrant::Errors::CLIInvalidUsage","httpStatus":null,"severity":"error","filePath":"plugins/commands/cloud/box/delete.rb","lineNumber":33,"sourceCode":"\n            opts = OptionParser.new do |o|\n              o.banner = \"Usage: vagrant cloud box delete [options] organization/box-name\"\n              o.separator \"\"\n              o.separator \"Deletes box entry on Vagrant Cloud\"\n              o.separator \"\"\n              o.separator \"Options:\"\n              o.separator \"\"\n\n              o.on(\"-f\", \"--[no-]force\", \"Do not prompt for deletion 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.empty? || argv.length > 1\n              raise Vagrant::Errors::CLIInvalidUsage,\n                help: opts.help.chomp\n            end\n\n            if !options[:force]\n              @env.ui.warn(I18n.t(\"cloud_command.box.delete_warn\", 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            org, box_name = argv.first.split('/', 2)\n            delete_box(org, box_name, @client.token)\n          end\n\n          # Delete the requested box\n          #\n          # @param [String] org Organization name of box","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/commands/cloud/box/delete.rb#L15-L51","documentation":"`vagrant cloud box delete` requires exactly one positional argument: the `org/box-name` identifier of the box to delete. CLIInvalidUsage is raised when argv is empty or has more than one entry; the message includes the command help describing the -f/--force flag that skips the deletion confirmation prompt.","triggerScenarios":"Running `vagrant cloud box delete` with no argument; passing two or more positionals (e.g. `vagrant cloud box delete myorg mybox`); extra trailing arguments forwarded by a wrapper script.","commonSituations":"Splitting the org and box name into two arguments; scripting a delete loop where the identifier variable is sometimes empty; expecting a confirmation answer to be a positional argument.","solutions":["Pass exactly one identifier: `vagrant cloud box delete myorg/mybox`","Add -f to skip the y/N prompt in scripts: `vagrant cloud box delete -f myorg/mybox`","Verify the identifier exists first with `vagrant cloud box show myorg/mybox`"],"exampleFix":"# before\nvagrant cloud box delete myorg mybox\n# after\nvagrant cloud box delete -f myorg/mybox","handlingStrategy":"validation","validationCode":"# bash: exactly one argument, and it must contain a slash\nif [ \"$#\" -ne 1 ] || ! [[ \"$1\" == */* ]]; then\n  echo \"usage: vagrant cloud box delete [-f] org/box-name\" >&2\n  exit 64\nfi\nexec vagrant cloud box delete \"$@\"","typeGuard":null,"tryCatchPattern":"begin\n  env.cli(%w[cloud box delete], org_box)\nrescue Vagrant::Errors::CLIInvalidUsage => e\n  $stderr.puts e.message.lines.first\n  exit 64\nend","preventionTips":["Verify the identifier with `vagrant cloud box show` before scripting deletes","Pass -f explicitly in automation so the prompt cannot wedge a script","Quote identifiers so org or box names containing spaces stay one argument"],"tags":["vagrant","vagrant-cloud","cli","argument-validation","box-management"],"backgroundTag":"cli-invalid-usage","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}