plugins/commands/snapshot/command/root.rb in vagrant-unbundled-2.2.2.0 vs plugins/commands/snapshot/command/root.rb in vagrant-unbundled-2.2.3.0
- old
+ new
@@ -46,17 +46,21 @@
end
def execute
if @main_args.include?("-h") || @main_args.include?("--help")
# Print the help for all the commands.
- return help
+ @env.ui.info(help, prefix: false)
+ return 0
end
# If we reached this far then we must have a subcommand. If not,
# then we also just print the help and exit.
command_class = @subcommands.get(@sub_command.to_sym) if @sub_command
- return help if !command_class || !@sub_command
+ if !command_class || !@sub_command
+ raise Vagrant::Errors::CLIInvalidUsage,
+ help: help()
+ end
@logger.debug("Invoking command class: #{command_class} #{@sub_args.inspect}")
# Initialize and execute the command class
command_class.new(@sub_args, @env).execute
end
@@ -79,10 +83,10 @@
opts.separator ""
opts.separator "For help on any individual subcommand run `vagrant snapshot <subcommand> -h`"
end
- @env.ui.info(opts.help, prefix: false)
+ opts.help
end
end
end
end
end