{"record":{"id":"63ab006e650f622c","repo":"hashicorp/vagrant","slug":"this-command-was-not-invoked-properly-the-help-fo-63ab00","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/plugin/command/license.rb","lineNumber":20,"sourceCode":"# SPDX-License-Identifier: BUSL-1.1\n\nrequire 'optparse'\n\nrequire_relative \"base\"\n\nmodule VagrantPlugins\n  module CommandPlugin\n    module Command\n      class License < Base\n        def execute\n          opts = OptionParser.new do |o|\n            o.banner = \"Usage: vagrant plugin license <name> <license-file> [-h]\"\n          end\n\n          # Parse the options\n          argv = parse_options(opts)\n          return if !argv\n          raise Vagrant::Errors::CLIInvalidUsage, help: opts.help.chomp if argv.length < 2\n\n          # License the plugin\n          action(Action.action_license, {\n            plugin_license_path: argv[1],\n            plugin_name:         argv[0]\n          })\n\n          # Success, exit status 0\n          0\n        end\n      end\n    end\n  end\nend\n","sourceCodeStart":2,"sourceCodeEnd":35,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/commands/plugin/command/license.rb#L2-L35","documentation":"`vagrant plugin license <name> <license-file>` requires at least two positional arguments. After parse_options, argv.length < 2 raises Vagrant::Errors::CLIInvalidUsage with the help text; argv[0] becomes the plugin name and argv[1] the license path handed to the licensing middleware.","triggerScenarios":"`vagrant plugin license my-plugin` (license path omitted) or bare `vagrant plugin license`; supplying name and path as one quoted word.","commonSituations":"Typing the command from memory and forgetting the file argument; shell quoting that accidentally joins the two args.","solutions":["Re-run with both arguments: `vagrant plugin license <name> /abs/path/to/license.lic`.","Confirm the usage line with `vagrant plugin license -h`."],"exampleFix":"# before\nvagrant plugin license my-plugin\n# after\nvagrant plugin license my-plugin /home/me/licenses/my-plugin.lic","handlingStrategy":"validation","validationCode":"abort 'usage: vagrant plugin license <name> <license-file>' unless ARGV.length >= 2\nname, path = ARGV\nabort \"no such file: #{path}\" unless File.file?(File.expand_path(path))\nsystem('vagrant', 'plugin', 'license', name, path)","typeGuard":null,"tryCatchPattern":"begin\n  Vagrant::Environment.new.cli(['plugin', 'license', name, path])\nrescue Vagrant::Errors::CLIInvalidUsage => e\n  warn e.message\n  exit 1\nend","preventionTips":["Mnemonic: license takes two args — who and where.","Validate both the arg count and the file's existence up front.","Keep licensing steps in a documented runbook with concrete paths."],"tags":["vagrant","plugin","license","cli","usage"],"backgroundTag":"invalid-cli-usage","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}