diff --git a/lib/vagrant/command/base.rb b/lib/vagrant/command/base.rb index 55044a7bf..9ccf4c3d5 100644 --- a/lib/vagrant/command/base.rb +++ b/lib/vagrant/command/base.rb @@ -26,10 +26,8 @@ module Vagrant # 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 3c4174eaf..d791e9f3a 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 d0c842a6f..a2198000f 100644 --- a/lib/vagrant/command/group_base.rb +++ b/lib/vagrant/command/group_base.rb @@ -18,9 +18,6 @@ module Vagrant # 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 9e12d90db..5918387fc 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 b85519027..3e2b4b9a8 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 eed73ca24..b1d4ca933 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 576880c69..dd3320290 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 7f3968fb4..df72ddda6 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 f9af2ca90..d76790f36 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 958d26ef8..b5d03a91c 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 311b05aac..645097148 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 22dfde202..d5ba6f8af 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 78e39b6e9..e63327768 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 4e29f64cf..74cac6a96 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 b77461b72..a9d480838 100644 --- a/lib/vagrant/command/upgrade_to_060.rb +++ b/lib/vagrant/command/upgrade_to_060.rb @@ -3,8 +3,7 @@ require 'fileutils' 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 59d99a7f9..324751905 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",