From a3d9615a13cfb86072b2bed376ec93a1974a2e54 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 6 Feb 2012 22:52:34 -0500 Subject: [PATCH] Custom help for `vagrant gem` on top of RubyGems help --- lib/vagrant/command/gem.rb | 8 ++++++++ templates/locales/en.yml | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/lib/vagrant/command/gem.rb b/lib/vagrant/command/gem.rb index fe558b1e5..4a135acac 100644 --- a/lib/vagrant/command/gem.rb +++ b/lib/vagrant/command/gem.rb @@ -15,6 +15,14 @@ module Vagrant end end + # If the user needs some help, we add our own little message at the + # top so that they're aware of what `vagrant gem` is doing, really. + if @argv.empty? || @argv.include?("-h") || @argv.include?("--help") + @env.ui.info(I18n.t("vagrant.commands.gem.help_preamble"), + :prefix => false) + puts + end + # We just proxy the arguments onto a real RubyGems command # but change `GEM_HOME` so that the gems are installed into # our own private gem folder. diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 1789821df..d870cfd76 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -231,6 +231,13 @@ en: vm_not_running: "VM is not currently running. Please bring it up to run this command." box: no_installed_boxes: "There are no installed boxes! Use `vagrant box add` to add some." + gem: + help_preamble: |- + `vagrant gem` is used to install Vagrant plugins via the RubyGems + system. In fact, `vagrant gem` is just a frontend to the actual `gem` + interface, with the difference being that Vagrant sets up a custom + directory where gems are installed so that they are isolated from your + system gems. init: success: |- A `Vagrantfile` has been placed in this directory. You are now