Sha256: a50859c4929808ec5097971973fc782cba0f8f7ba93fdda222ffbf0dc5de5598

Contents?: true

Size: 801 Bytes

Versions: 2

Compression:

Stored size: 801 Bytes

Contents

class Thor
  class Options < Arguments
    def check_unknown!
      # thor >= 0.15.0
      unknown = if defined? @extra
        # an unknown option starts with - or -- and has no more --'s afterward.
        @extra.select { |str| str =~ /^--?(?:(?!--).)*$/ }
      # thor < 0.15.0
      else
        @unknown
      end
      raise UnknownArgumentError, "shelly: unrecognized option '#{unknown.join(', ')}'\n" +
        "Usage: shelly [COMMAND]... [OPTIONS]\n" +
        "Try 'shelly --help' for more information" unless unknown.empty?
    end
  end
end


 def check_unknown!
      raise UnknownArgumentError, "shelly: unrecognized option '#{@unknown.join(', ')}'\n" +
        "Usage: shelly [COMMAND]... [OPTIONS]\n" +
        "Try 'shelly --help' for more information" unless @unknown.empty?
    end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shelly-0.2.7 lib/thor/options.rb
shelly-0.2.6.pre lib/thor/options.rb