From 91d19b91e4f934a40573fc4ccc3ba789533cd26f Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 17 Dec 2011 12:02:19 -0800 Subject: [PATCH] Improved help output for `vagrant` cli --- lib/vagrant/cli.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/vagrant/cli.rb b/lib/vagrant/cli.rb index 09a5597d5..4158f16dd 100644 --- a/lib/vagrant/cli.rb +++ b/lib/vagrant/cli.rb @@ -48,6 +48,20 @@ module Vagrant opts.separator "" opts.on("-v", "--version", "Print the version and exit.") opts.on("-h", "--help", "Print this help.") + opts.separator "" + opts.separator "Available subcommands:" + + # Add the available subcommands as separators in order to print them + # out as well. + keys = [] + Vagrant.commands.each { |key, value| keys << key } + + keys.sort.each do |key| + opts.separator " #{key}" + end + + opts.separator "" + opts.separator "For help on any individual command run `vagrant COMMAND -h`" end @env.ui.info(opts.help, :prefix => false)