Closed Yegorov closed 5 years ago
When i run this script, some options not parsed correctly, for example:
Script:
require 'bundler/inline' gemfile do source 'https://rubygems.org' gem 'thor', '= 0.20.3' end class ExampleThor < Thor include Thor::Actions default_command :example class_option :cls_opt, default: 'test' desc 'example', 'Example command' method_option :flag1, default: false, type: :boolean, aliases: '-D' method_option :flag2, default: false, type: :boolean, aliases: '-F' def example say 'Test, test, test!!!', :green end end ExampleThor.start(ARGV)
How i run it:
# It's ok! $ ruby ./thor-bug.rb -F -D Test, test, test!!! # Error! Why? $ ruby ./thor-bug.rb -D -F Could not find command "_F". # It's ok! $ ruby ./thor-bug.rb --flag1 --flag2 Test, test, test!!! # Error! Why? $ ruby ./thor-bug.rb -D --flag2 Could not find command "__flag2".
-D is marked as a help flag for some reason https://github.com/erikhuda/thor/blob/master/lib/thor/base.rb#L17
-D
@snowe2010 ok, thanks, for help me!
When i run this script, some options not parsed correctly, for example:
Script:
How i run it: