module Argy
Constants
- CoersionError
An error that is raised when an option cannot be coerced to the correct type
- Error
Base class for all of Argy's errors.
- VERSION
- ValidationError
An error that is raised when an option is not valid.
Public Class Methods
new(&block)
click to toggle source
Define a new parser. @see Parser
@example
parser = Argy.new do |o| o.argument :input, desc: "the input file" o.option :verbose, type: :boolean end options = parser.parse(ARGV)
# File lib/argy.rb, line 37 def self.new(&block) Argy::Parser.new(&block) end
parse(argv: ARGV, &block)
click to toggle source
Define a parser and return the options in one go. @see Parser
@example
options = Argy.parse do o.argument :input, desc: "the input file" o.option :verbose, type: :boolean end
# File lib/argy.rb, line 48 def self.parse(argv: ARGV, &block) new(&block).parse(argv) end