Method: Thor::Base#is_option

Defined in:
lib/cnvrg/cli.rb

#is_option(options, p) ⇒ Object



138
139
140
141
142
143
144
145
146
147
148
# File 'lib/cnvrg/cli.rb', line 138

def is_option (options, p)
  options.each do |o|
    if !o.aliases.nil?
      if (o.aliases.is_a? Array and o.aliases.include? p) or (o.aliases.is_a? Array and o.aliases.size == 1 and o.aliases[0].split(",").include? p) or o.switch_name.eql? p
        return o
      end
    end

  end
  return false
end