From c0e3047af782fe934d0e18e2839ed0ca21ad2571 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 30 Sep 2010 00:07:01 -0700 Subject: [PATCH] Subcommand help shows proper full command in task listing. [closes GH-168] --- CHANGELOG.md | 1 + lib/vagrant/command/group_base.rb | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8800d89a7..7be5de0e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## 0.6.4 (unreleased) + - Subcommand help shows proper full command in task listing. [GH-168] - SSH gives error message if `ssh` binary is not found. [GH-161] - SSH gives proper error message if VM is not running. [GH-167] - Fix some issues with undefined constants in command errors. diff --git a/lib/vagrant/command/group_base.rb b/lib/vagrant/command/group_base.rb index d3a940d68..95ef6ef78 100644 --- a/lib/vagrant/command/group_base.rb +++ b/lib/vagrant/command/group_base.rb @@ -87,13 +87,21 @@ module Vagrant # @param [String] description # @param [Hash] opts def self.register(usage, description, opts=nil) - CLI.register(self, Base.extract_name_from_usage(usage), usage, description, opts) + @_name = Base.extract_name_from_usage(usage) + CLI.register(self, @_name, usage, description, opts) end def initialize(*args) super initialize_environment(*args) end + + protected + + # Override the basename to include the subcommand name. + def self.basename + "#{super} #{@_name}" + end end end end