{"record":{"id":"e9d82e13ef9e60d6","repo":"hashicorp/vagrant","slug":"an-invalid-option-was-specified-the-help-for-this","errorCode":null,"errorMessage":"An invalid option was specified. The help for this command\nis available below.\n\n%{help}","messagePattern":"An invalid option was specified\\. The help for this command\nis available below\\.\n\n%(.+?)","errorType":"exception","errorClass":"Vagrant::Errors::CLIInvalidOptions","httpStatus":null,"severity":"error","filePath":"lib/vagrant/plugin/v1/command.rb","lineNumber":56,"sourceCode":"        # was printed and parsing failed.\n        def parse_options(opts=nil)\n          # Creating a shallow copy of the arguments so the OptionParser\n          # doesn't destroy the originals.\n          argv = @argv.dup\n\n          # Default opts to a blank optionparser if none is given\n          opts ||= OptionParser.new\n\n          # Add the help option, which must be on every command.\n          opts.on_tail(\"-h\", \"--help\", \"Print this help\") do\n            safe_puts(opts.help)\n            return nil\n          end\n\n          opts.parse!(argv)\n          return argv\n        rescue OptionParser::InvalidOption\n          raise Errors::CLIInvalidOptions, help: opts.help.chomp\n        end\n\n        # Yields a VM for each target VM for the command.\n        #\n        # This is a convenience method for easily implementing methods that\n        # take a target VM (in the case of multi-VM) or every VM if no\n        # specific VM name is specified.\n        #\n        # @param [String] name The name of the VM. Nil if every VM.\n        # @param [Boolean] single_target If true, then an exception will be\n        #   raised if more than one target is found.\n        def with_target_vms(names=nil, options=nil)\n          # Using VMs requires a Vagrant environment to be properly setup\n          raise Errors::NoEnvironmentError if !@env.root_path\n\n          # Setup the options hash\n          options ||= {}\n","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/plugin/v1/command.rb#L38-L74","documentation":"A v1-API plugin command received a command-line option its OptionParser does not recognize; the rescue in parse_options (lib/vagrant/plugin/v1/command.rb:56) converts OptionParser::InvalidOption into CLIInvalidOptions and embeds the command's help text as %{help}. It is purely a usage error in the arguments passed to that subcommand. V1 is the legacy plugin API, so this error comes from old third-party plugin commands.","triggerScenarios":"Running `vagrant <old-plugin-command> --unknown-flag` where the flag is not declared in the command's opt_parser OptionParser: a typo like `--provder`, an option removed in the installed plugin version, or an option that only exists in a newer release than the one installed.","commonSituations":"Typo'd flags in manual runs or scripts; commands copy-pasted from docs written for a different plugin version; shell aliases that append stale flags.","solutions":["Re-run with `-h`/`--help` to list the options the command actually accepts","Fix the misspelled or unsupported flag in your command line or script","Update the plugin — the option may exist in a newer release","If you maintain the plugin, declare the option in the command's opt_parser block"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"begin\n  command_class.parse(argv)\nrescue Vagrant::Errors::CLIInvalidOptions => e\n  # e.extra_data[:help] holds the command's full help text\n  warn e.message\nend","preventionTips":["Run `vagrant <command> --help` before scripting an unfamiliar plugin command","Quote flags and prefer full long-option names in scripts","Pin plugin versions so documented flags match the installed release"],"tags":["cli","options","usage","v1-plugins"],"backgroundTag":"invalid-command-line-argument","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}