{"record":{"id":"053ba461b0c1881a","repo":"hashicorp/vagrant","slug":"this-command-was-not-invoked-properly-the-help-fo-053ba4","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/update.rb","lineNumber":39,"sourceCode":"              o.separator \"Options:\"\n              o.separator \"\"\n\n              o.on(\"-d\", \"--description DESCRIPTION\", \"Full description of the box\") do |d|\n                options[:description] = d\n              end\n              o.on(\"-s\", \"--short-description DESCRIPTION\", \"Short description of the box\") do |s|\n                options[:short] = s\n              end\n              o.on(\"-p\", \"--[no-]private\", \"Makes box private\") do |p|\n                options[:private] = p\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 || options.slice(:description, :short, :private).length == 0\n              raise Vagrant::Errors::CLIInvalidUsage,\n                help: opts.help.chomp\n            end\n\n            @client = client_login(@env)\n            org, box_name = argv.first.split('/', 2)\n\n            update_box(org, box_name, @client.token, options.slice(:short, :description, :private))\n          end\n\n          # Update an existing box\n          #\n          # @param [String] org Organization name of box\n          # @param [String] box_name Name of box\n          # @param [String] access_token User access token\n          # @param [Hash] options Options for box filtering\n          # @option options [String] :short Short description of box\n          # @option options [String] :description Full description of box\n          # @option options [Boolean] :private Set box visibility as private","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/commands/cloud/box/update.rb#L21-L57","documentation":"`vagrant cloud box update` raises CLIInvalidUsage in three cases: no positional argument, more than one, or exactly one argument but none of the update fields (--description, --short-description, --[no-]private) were supplied. The third branch exists because an update with nothing to change is meaningless; the command needs to know what to modify.","triggerScenarios":"Running `vagrant cloud box update` with no identifier; two or more positionals; `vagrant cloud box update myorg/mybox` with zero field flags — the guard `options.slice(:description, :short, :private).length == 0` fires.","commonSituations":"Expecting the command to re-sync metadata with no changes; setting only flags the command ignores (e.g. --force) and no actual field; forgetting the -d/-s/-p flags in ported scripts.","solutions":["Include at least one field: `vagrant cloud box update -s \"New short description\" myorg/mybox`","Use exactly one positional identifier in org/box-name form","Check `vagrant cloud box update -h` to see all accepted field options"],"exampleFix":"# before\nvagrant cloud box update myorg/mybox\n# after\nvagrant cloud box update -p --short-description \"Updated box\" myorg/mybox","handlingStrategy":"validation","validationCode":"# Mirror the command's own contract: exactly one positional plus at least one field flag\npos = args.reject { |a| a.start_with?(\"-\") }\nhas_field = args.any? { |a| %w[-d -s -p --description --short-description --private --no-private].include?(a) }\nunless pos.size == 1 && has_field\n  abort \"usage: vagrant cloud box update org/box-name (-d | -s | -p)\"\nend","typeGuard":null,"tryCatchPattern":"begin\n  env.cli(%w[cloud box update], org_box, \"-s\", short_desc)\nrescue Vagrant::Errors::CLIInvalidUsage => e\n  $stderr.puts e.message.lines.first\n  exit 64\nend","preventionTips":["Decide up front which field(s) a script updates and always pass at least one","Treat 'nothing to update' as an input error in your tooling, not a valid run","Quote description strings so -s/-d values never become positionals"],"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"}