Skip to content

Commit

Permalink
subcommand name in ARGV can be a shorthand
Browse files Browse the repository at this point in the history
be sure to check subcommand name after the completion
  • Loading branch information
amatsuda authored and indirect committed Jun 12, 2011
1 parent b27c2fb commit 43bd22e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/bundler/cli.rb
Expand Up @@ -14,7 +14,7 @@ def initialize(*)
Bundler.rubygems.ui = UI::RGProxy.new(Bundler.ui)
end

check_unknown_options! unless ARGV.include?("exec") || ARGV.include?("config")
check_unknown_options!

default_task :install
class_option "no-color", :type => :boolean, :banner => "Disable colorization in output"
Expand Down
4 changes: 3 additions & 1 deletion lib/bundler/vendor/thor/parser/options.rb
Expand Up @@ -85,7 +85,9 @@ def parse(args)
end

def check_unknown!
raise UnknownArgumentError, "Unknown switches '#{@unknown.join(', ')}'" unless @unknown.empty?
unless ARGV.include?("exec") || ARGV.include?("config")
raise UnknownArgumentError, "Unknown switches '#{@unknown.join(', ')}'" unless @unknown.empty?
end
end

protected
Expand Down

0 comments on commit 43bd22e

Please sign in to comment.