lib/thor/parser/option.rb in thor-1.2.1 vs lib/thor/parser/option.rb in thor-1.2.2
- old
+ new
@@ -56,11 +56,11 @@
type = case value
when Symbol
default = nil
if VALID_TYPES.include?(value)
value
- elsif required = (value == :required) # rubocop:disable AssignmentInCondition
+ elsif required = (value == :required) # rubocop:disable Lint/AssignmentInCondition
:string
end
when TrueClass, FalseClass
:boolean
when Numeric
@@ -91,13 +91,17 @@
if boolean?
sample << ", [#{dasherize('no-' + human_name)}]" unless (name == "force") || name.start_with?("no-")
end
+ aliases_for_usage.ljust(padding) + sample
+ end
+
+ def aliases_for_usage
if aliases.empty?
- (" " * padding) << sample
+ ""
else
- "#{aliases.join(', ')}, #{sample}"
+ "#{aliases.join(', ')}, "
end
end
VALID_TYPES.each do |type|
class_eval <<-RUBY, __FILE__, __LINE__ + 1