mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Print proper "Usage:" messages for "rails plugin" command
* suppress outputting "Unknown command:" when no command were specified * output the "Usage:" message when no plugin names were given [#5043 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
This commit is contained in:
committed by
Jeremy Kemper
parent
ff44cc2844
commit
bf5d154567
@@ -335,7 +335,7 @@ module Commands
|
||||
command = Commands.const_get(command.capitalize).new(self)
|
||||
command.parse!(sub)
|
||||
else
|
||||
puts "Unknown command: #{command}"
|
||||
puts "Unknown command: #{command}" unless command.blank?
|
||||
puts options
|
||||
exit 1
|
||||
end
|
||||
@@ -345,7 +345,7 @@ module Commands
|
||||
left = []
|
||||
left << args.shift while args[0] and args[0] =~ /^-/
|
||||
left << args.shift if args[0]
|
||||
return [left, args]
|
||||
[left, args]
|
||||
end
|
||||
|
||||
def self.parse!(args=ARGV)
|
||||
@@ -410,6 +410,10 @@ module Commands
|
||||
|
||||
def parse!(args)
|
||||
options.parse!(args)
|
||||
if args.blank?
|
||||
puts options
|
||||
exit 1
|
||||
end
|
||||
environment = @base_command.environment
|
||||
install_method = determine_install_method
|
||||
puts "Plugins will be installed using #{install_method}" if $verbose
|
||||
@@ -438,6 +442,10 @@ module Commands
|
||||
|
||||
def parse!(args)
|
||||
options.parse!(args)
|
||||
if args.blank?
|
||||
puts options
|
||||
exit 1
|
||||
end
|
||||
root = @base_command.environment.root
|
||||
args.each do |name|
|
||||
::Plugin.new(name).uninstall
|
||||
|
||||
Reference in New Issue
Block a user