{"record":{"id":"eb71ca3e978b3dec","repo":"hashicorp/vagrant","slug":"this-command-was-not-invoked-properly-the-help-fo-eb71ca","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/auth/logout.rb","lineNumber":24,"sourceCode":"module VagrantPlugins\n  module CloudCommand\n    module AuthCommand\n      module Command\n        class Logout < Vagrant.plugin(\"2\", :command)\n          def execute\n            options = {}\n\n            opts = OptionParser.new do |o|\n              o.banner = \"Usage: vagrant cloud auth logout\"\n              o.separator \"\"\n              o.separator \"Log out of Vagrant Cloud\"\n            end\n\n            # Parse the options\n            argv = parse_options(opts)\n            return if !argv\n            if !argv.empty?\n              raise Vagrant::Errors::CLIInvalidUsage,\n                help: opts.help.chomp\n            end\n\n            @client = Client.new(@env)\n            @client.clear_token\n            @env.ui.success(I18n.t(\"cloud_command.logged_out\"))\n            return 0\n          end\n        end\n      end\n    end\n  end\nend\n","sourceCodeStart":6,"sourceCodeEnd":38,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/commands/cloud/auth/logout.rb#L6-L38","documentation":"Raised by `vagrant cloud auth logout` when any positional argument is present. The command takes no arguments at all - it instantiates the Cloud client and clears the stored token - so any extra word after `logout` triggers the usage error with the embedded help.","triggerScenarios":"`vagrant cloud auth logout now`, `vagrant cloud auth logout --all`, or any invocation leaving positional words after parse_options.","commonSituations":"Copy-paste from other CLIs where logout takes a flag or scope; shell aliases appending words.","solutions":["Run the bare command: `vagrant cloud auth logout`","Run `vagrant cloud auth logout --help` to confirm it accepts no arguments","Remove stray words from scripts"],"exampleFix":"# before\nvagrant cloud auth logout now\n\n# after\nvagrant cloud auth logout","handlingStrategy":"validation","validationCode":"# bash: logout accepts no positional arguments\n[ $# -eq 0 ] || { vagrant cloud auth logout --help; exit 1; }\nvagrant cloud auth logout","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the bare command `vagrant cloud auth logout` - no scopes or flags exist","Avoid copying logout syntax from other CLIs (docker logout, gh auth logout)","In CI, treat logout as cleanup: call it bare and ignore failure"],"tags":["cli","usage","cloud","auth","arguments"],"backgroundTag":"cli-invalid-usage","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}