vendor/bundle/ruby/1.9.1/gems/thor-0.14.6/lib/thor/parser/options.rb
# Parse the value at the peek analyzing if it requires an input or not.
#
Parse the value at the peek analyzing if it requires an input or not.
Parse the value at the peek analyzing if it requires an input or not .
def parse_peek(switch, option)
        if current_is_switch_formatted? || last?
          if option.boolean?
          elsif no_or_skip?(switch)
            return nil 
          elsif option.string? && !option.required?
            return option.lazy_default || option.default || option.human_name
          elsif option.lazy_default
            return option.lazy_default
          else
            raise MalformattedArgumentError, "No value provided for option '#{switch}'"
          end
        end
        @non_assigned_required.delete(option)
        send(:"parse_#{option.type}", switch)
      end
def parse_peek ( switch , option ) if current_is_switch_formatted? || last? if option . boolean? elsif no_or_skip? ( switch ) return nil elsif option . string? && ! option . required? return option . lazy_default || option . default || option . human_name elsif option . lazy_default return option . lazy_default else raise MalformattedArgumentError , "No value provided for option '#{switch}'" end end @non_assigned_required . delete ( option ) send ( :" parse_ #{ option . type } " , switch ) end
Parse the value at the peek analyzing if it requires an input or not.
Parse the value at the peek analyzing if it requires an input or not .
# No problem for boolean types # User set value to nil # Return the default if there is one, else the human name
switch
<not_specific>
option
<not_specific>