{"record":{"id":"530bfcc521e5f0aa","repo":"hashicorp/vagrant","slug":"this-command-was-not-invoked-properly-the-help-fo-530bfc","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/provider/delete.rb","lineNumber":32,"sourceCode":"            options = {}\n\n            opts = OptionParser.new do |o|\n              o.banner = \"Usage: vagrant cloud provider delete [options] organization/box-name provider-name version [architecture]\"\n              o.separator \"\"\n              o.separator \"Deletes a provider entry on Vagrant Cloud\"\n              o.separator \"\"\n              o.separator \"Options:\"\n              o.separator \"\"\n              o.on(\"-f\", \"--[no-]force\", \"Force deletion of box version provider 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.count < 3 || argv.count > 4\n              raise Vagrant::Errors::CLIInvalidUsage,\n                help: opts.help.chomp\n            end\n\n            org, box_name = argv.first.split('/', 2)\n            provider_name = argv[1]\n            version = argv[2]\n            architecture = argv[3]\n\n            @client = client_login(@env)\n            account = VagrantCloud::Account.new(\n              custom_server: api_server_url,\n              access_token: @client.token\n            )\n\n            if architecture.nil?\n              architecture = select_provider_architecture(account, org, box_name, version, provider_name)\n            end\n","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/commands/cloud/provider/delete.rb#L14-L50","documentation":"`vagrant cloud provider delete` requires three or four positional arguments: `organization/box-name`, provider name, version, and optionally an architecture. Fewer than three or more than four entries raises CLIInvalidUsage; note the confirmation prompt (skippable with -f) only runs after the argument guard passes.","triggerScenarios":"`vagrant cloud provider delete myorg/mybox` (provider and version missing); only three of the needed pieces plus an extra trailing argument; a version passed twice.","commonSituations":"Copying the two-argument style from `vagrant cloud box delete`; forgetting that architecture is a positional here; scripts that always pass four args hitting the >4 guard when an identifier contains a space and splits.","solutions":["Use the exact form: `vagrant cloud provider delete org/box-name provider version [architecture]`","Add -f to skip the y/N confirmation in automation","Check `vagrant cloud provider delete -h` for the banner"],"exampleFix":"# before\nvagrant cloud provider delete myorg/mybox\n# after\nvagrant cloud provider delete -f myorg/mybox virtualbox 1.0.0","handlingStrategy":"validation","validationCode":"# bash: enforce 3-or-4 arguments, first one slash-separated\nif [ \"$#\" -lt 3 ] || [ \"$#\" -gt 4 ] || ! [[ \"$1\" == */* ]]; then\n  echo \"usage: vagrant cloud provider delete [-f] org/box-name provider version [architecture]\" >&2\n  exit 64\nfi\nexec vagrant cloud provider delete \"$@\"","typeGuard":null,"tryCatchPattern":"begin\n  env.cli(%w[cloud provider delete], org_box, provider, version, arch)\nrescue Vagrant::Errors::CLIInvalidUsage => e\n  $stderr.puts e.message.lines.first\n  exit 64\nend","preventionTips":["Remember architecture is a positional here, unlike in create","Pass -f in automation so the confirmation cannot block a pipeline","Quote identifiers so counts stay 3-4 even with spaces in names"],"tags":["vagrant","vagrant-cloud","cli","argument-validation","provider-management"],"backgroundTag":"cli-invalid-usage","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}