diff --git a/lib/vagrant/command/base.rb b/lib/vagrant/command/base.rb index 55044a7bff6..9ccf4c3d5c7 100644 --- a/lib/vagrant/command/base.rb +++ b/lib/vagrant/command/base.rb @@ -26,10 +26,8 @@ class Base < Thor::Group # given name. The name will be used for accessing it from the CLI, # so if you name it "lamp", then the command to invoke this # will be `vagrant lamp`. - # - # The description added to the class via the `desc` method will be - # used as a description for the command. - def self.register(usage, opts=nil) + def self.register(usage, description, opts=nil) + desc description CLI.register(self, extract_name_from_usage(usage), usage, desc, opts) end diff --git a/lib/vagrant/command/destroy.rb b/lib/vagrant/command/destroy.rb index 3c4174eaf64..d791e9f3ae9 100644 --- a/lib/vagrant/command/destroy.rb +++ b/lib/vagrant/command/destroy.rb @@ -1,8 +1,7 @@ module Vagrant module Command class DestroyCommand < NamedBase - desc "Destroy the environment, deleting the created virtual machines" - register "destroy" + register "destroy", "Destroy the environment, deleting the created virtual machines" def execute target_vms.each do |vm| diff --git a/lib/vagrant/command/group_base.rb b/lib/vagrant/command/group_base.rb index d0c842a6f62..a2198000f2b 100644 --- a/lib/vagrant/command/group_base.rb +++ b/lib/vagrant/command/group_base.rb @@ -18,9 +18,6 @@ class GroupBase < Thor # usage. The usage will be used for accessing it from the CLI, # so if you give it a usage of `lamp [subcommand]`, then the command # to invoke this will be `vagrant lamp` (with a subcommand). - # - # Additionally, unlike {Base}, a description must be specified to - # this register command, since there is no class-wide description. def self.register(usage, description, opts=nil) CLI.register(self, Base.extract_name_from_usage(usage), usage, description, opts) end diff --git a/lib/vagrant/command/halt.rb b/lib/vagrant/command/halt.rb index 9e12d90dbf5..5918387fcf0 100644 --- a/lib/vagrant/command/halt.rb +++ b/lib/vagrant/command/halt.rb @@ -1,9 +1,8 @@ module Vagrant module Command class HaltCommand < NamedBase - desc "Halt the running VMs in the environment" class_option :force, :type => :boolean, :default => false, :aliases => "-f" - register "halt" + register "halt", "Halt the running VMs in the environment" def execute target_vms.each do |vm| diff --git a/lib/vagrant/command/init.rb b/lib/vagrant/command/init.rb index b85519027b3..3e2b4b9a84f 100644 --- a/lib/vagrant/command/init.rb +++ b/lib/vagrant/command/init.rb @@ -1,11 +1,10 @@ module Vagrant module Command class InitCommand < Base - desc "Initializes the current folder for Vagrant usage" argument :box_name, :type => :string, :optional => true, :default => "base" argument :box_url, :type => :string, :optional => true source_root File.expand_path("templates/commands/init", Vagrant.source_root) - register "init [box_name] [box_url]" + register "init [box_name] [box_url]", "Initializes the current folder for Vagrant usage" def execute template "Vagrantfile.erb", "Vagrantfile" diff --git a/lib/vagrant/command/package.rb b/lib/vagrant/command/package.rb index eed73ca2413..b1d4ca933b4 100644 --- a/lib/vagrant/command/package.rb +++ b/lib/vagrant/command/package.rb @@ -1,12 +1,11 @@ module Vagrant module Command class PackageCommand < NamedBase - desc "Package a Vagrant environment for distribution" class_option :base, :type => :string, :default => nil class_option :output, :type => :string, :default => nil class_option :include, :type => :array, :default => nil class_option :vagrantfile, :type => :string, :default => nil - register "package" + register "package", "Package a Vagrant environment for distribution" def execute return package_base if options[:base] diff --git a/lib/vagrant/command/provision.rb b/lib/vagrant/command/provision.rb index 576880c698c..dd332029007 100644 --- a/lib/vagrant/command/provision.rb +++ b/lib/vagrant/command/provision.rb @@ -1,8 +1,7 @@ module Vagrant module Command class ProvisionCommand < NamedBase - desc "Rerun the provisioning scripts on a running VM" - register "provision" + register "provision", "Rerun the provisioning scripts on a running VM" def execute target_vms.each do |vm| diff --git a/lib/vagrant/command/reload.rb b/lib/vagrant/command/reload.rb index 7f3968fb475..df72ddda657 100644 --- a/lib/vagrant/command/reload.rb +++ b/lib/vagrant/command/reload.rb @@ -1,8 +1,7 @@ module Vagrant module Command class ReloadCommand < NamedBase - desc "Reload the environment, halting it then restarting it." - register "reload" + register "reload", "Reload the environment, halting it then restarting it." def execute target_vms.each do |vm| diff --git a/lib/vagrant/command/resume.rb b/lib/vagrant/command/resume.rb index f9af2ca90af..d76790f36ac 100644 --- a/lib/vagrant/command/resume.rb +++ b/lib/vagrant/command/resume.rb @@ -1,8 +1,7 @@ module Vagrant module Command class ResumeCommand < NamedBase - desc "Resume a suspended Vagrant environment." - register "resume" + register "resume", "Resume a suspended Vagrant environment." def execute target_vms.each do |vm| diff --git a/lib/vagrant/command/ssh.rb b/lib/vagrant/command/ssh.rb index 958d26ef840..b5d03a91c88 100644 --- a/lib/vagrant/command/ssh.rb +++ b/lib/vagrant/command/ssh.rb @@ -1,9 +1,8 @@ module Vagrant module Command class SSHCommand < NamedBase - desc "SSH into the currently running Vagrant environment." class_option :execute, :type => :string, :default => false, :aliases => "-e" - register "ssh" + register "ssh", "SSH into the currently running Vagrant environment." def execute if options[:execute] diff --git a/lib/vagrant/command/ssh_config.rb b/lib/vagrant/command/ssh_config.rb index 311b05aac9c..6450971483c 100644 --- a/lib/vagrant/command/ssh_config.rb +++ b/lib/vagrant/command/ssh_config.rb @@ -1,9 +1,8 @@ module Vagrant module Command class SSHConfigCommand < NamedBase - desc "outputs .ssh/config valid syntax for connecting to this environment via ssh" class_option :host, :type => :string, :default => nil, :aliases => "-h" - register "ssh_config" + register "ssh_config", "outputs .ssh/config valid syntax for connecting to this environment via ssh" def execute raise MultiVMTargetRequired.new(:command => "ssh_config") if target_vms.length > 1 diff --git a/lib/vagrant/command/status.rb b/lib/vagrant/command/status.rb index 22dfde202da..d5ba6f8afb4 100644 --- a/lib/vagrant/command/status.rb +++ b/lib/vagrant/command/status.rb @@ -1,9 +1,8 @@ module Vagrant module Command class StatusCommand < Base - desc "Shows the status of the current Vagrant environment." argument :name, :type => :string, :optional => true - register "status" + register "status", "Shows the status of the current Vagrant environment." def route state = nil diff --git a/lib/vagrant/command/suspend.rb b/lib/vagrant/command/suspend.rb index 78e39b6e9f9..e633277686b 100644 --- a/lib/vagrant/command/suspend.rb +++ b/lib/vagrant/command/suspend.rb @@ -1,8 +1,7 @@ module Vagrant module Command class SuspendCommand < NamedBase - desc "Suspend a running Vagrant environment." - register "suspend" + register "suspend", "Suspend a running Vagrant environment." def execute target_vms.each do |vm| diff --git a/lib/vagrant/command/up.rb b/lib/vagrant/command/up.rb index 4e29f64cf33..74cac6a96e5 100644 --- a/lib/vagrant/command/up.rb +++ b/lib/vagrant/command/up.rb @@ -1,9 +1,8 @@ module Vagrant module Command class UpCommand < NamedBase - desc "Creates the Vagrant environment" class_option :provision, :type => :boolean, :default => true - register "up" + register "up", "Creates the Vagrant environment" def execute # TODO: Make the options[:provision] actually mean something diff --git a/lib/vagrant/command/upgrade_to_060.rb b/lib/vagrant/command/upgrade_to_060.rb index b77461b72d6..a9d480838e1 100644 --- a/lib/vagrant/command/upgrade_to_060.rb +++ b/lib/vagrant/command/upgrade_to_060.rb @@ -3,8 +3,7 @@ module Vagrant module Command class UpgradeTo060Command < Base - desc "Upgrade pre-0.6.0 environment to 0.6.0" - register "upgrade_to_060", :hide => true + register "upgrade_to_060", "Upgrade pre-0.6.0 environment to 0.6.0", :hide => true def execute @env.ui.warn "vagrant.commands.upgrade_to_060.info", :_prefix => false diff --git a/lib/vagrant/command/version.rb b/lib/vagrant/command/version.rb index 59d99a7f989..324751905b5 100644 --- a/lib/vagrant/command/version.rb +++ b/lib/vagrant/command/version.rb @@ -1,8 +1,7 @@ module Vagrant module Command class VersionCommand < Base - desc "Prints the Vagrant version information" - register "version", :alias => %w(-v --version) + register "version", "Prints the Vagrant version information", :alias => %w(-v --version) def version env.ui.info("vagrant.commands.version.output",