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.cr
parser.cr
phreak.cr
root_parser.cr
subparser.cr

Constant Summary

VERSION = "0.1.0"

Class Method Summary

Class Method Detail

def self.create_parser(&block : RootParser -> Nil) : Parser #

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.


[View source]
def self.parse(args : Array(String), &block : RootParser -> Nil) : Nil #

Initializes a parser, and yields to a setup block with the created subparser.


[View source]
def self.parse!(&block : RootParser -> Nil) : Nil #

Equivalent to invoking Phreak::parse with args = ARGV.


[View source]