From 80666c03d634e8e7cc8f5a253ca3e5a38cba1efe Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 18 Jul 2013 12:11:36 -0400 Subject: [PATCH] vagrant help works [GH-1578] --- CHANGELOG.md | 4 ++++ plugins/commands/help/command.rb | 12 ++++++++++++ plugins/commands/help/plugin.rb | 17 +++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 plugins/commands/help/command.rb create mode 100644 plugins/commands/help/plugin.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 594e3e8b8..3e4e566b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## 1.2.5 (unreleased) +FEATURES: + + - `vagrant help ` now works. [GH-1578] + IMPROVEMENTS: - Remote commands that fail will now show the stdout/stderr of the diff --git a/plugins/commands/help/command.rb b/plugins/commands/help/command.rb new file mode 100644 index 000000000..08a847177 --- /dev/null +++ b/plugins/commands/help/command.rb @@ -0,0 +1,12 @@ +require 'optparse' + +module VagrantPlugins + module CommandHelp + class Command < Vagrant.plugin("2", :command) + def execute + return @env.cli([]) if @argv.empty? + @env.cli([@argv[0], "-h"]) + end + end + end +end diff --git a/plugins/commands/help/plugin.rb b/plugins/commands/help/plugin.rb new file mode 100644 index 000000000..4634a473a --- /dev/null +++ b/plugins/commands/help/plugin.rb @@ -0,0 +1,17 @@ +require "vagrant" + +module VagrantPlugins + module CommandHelp + class Plugin < Vagrant.plugin("2") + name "help command" + description <<-DESC + The `help` command shows help for the given command. + DESC + + command("help") do + require File.expand_path("../command", __FILE__) + Command + end + end + end +end