module Phreak
Overview
Phreak is a library for creating CLIs in the style of Crystal's built in OptionRootParser, but with much more flexibility.
Extended Modules
Defined in:
exceptions.crparser.cr
phreak.cr
root_parser.cr
subparser.cr
Constant Summary
-
VERSION =
"0.1.0"
Class Method Summary
-
.create_parser(&block : RootParser -> Nil) : Parser
Creates a reusable instance of
Parser
. -
.parse(args : Array(String), &block : RootParser -> Nil) : Nil
Initializes a parser, and yields to a setup block with the created subparser.
-
.parse!(&block : RootParser -> Nil) : Nil
Equivalent to invoking
Phreak::parse
with args = ARGV.
Class Method Detail
Creates a reusable instance of Parser
. This is opposed to other
class methods on Phreak, which are single-use. As a note, this
can also be done using Parser.new, but using this method is
preferred style for consistency.
def self.parse(args : Array(String), &block : RootParser -> Nil) : Nil
#
Initializes a parser, and yields to a setup block with the created subparser.
def self.parse!(&block : RootParser -> Nil) : Nil
#
Equivalent to invoking Phreak::parse
with args = ARGV.