class Phreak::RootParser

Overview

The internal master parsing class. This is where everything is initially kicked off.

Defined in:

root_parser.cr

Constructors

Instance Method Summary

Instance methods inherited from class Phreak::Subparser

banner : String | Nil banner, banner=(banner : String | Nil) banner=, bind(word : String | Nil = nil, long_flag : String | Nil = nil, short_flag : Char | Nil = nil, description : String | Nil = nil, &block : Subparser, String -> Nil) : Nil bind, command_section_width : Int8 command_section_width, command_section_width=(command_section_width : Int8) command_section_width=, fallback_description_padding : String fallback_description_padding, fallback_description_padding=(fallback_description_padding : String) fallback_description_padding=, fuzzy_bind(word : String | Nil = nil, long_flag : String | Nil = nil, description : String | Nil = nil, &block : Subparser, String -> Nil) : Nil fuzzy_bind, grab(&block : Subparser, String -> Nil) : Nil grab, help_indent : String help_indent, help_indent=(help_indent : String) help_indent=, max_fuzzy_distance=(max_fuzzy_distance : Int32) max_fuzzy_distance=, missing_args(&block : String -> ) missing_args, to_s(io : IO) : Nil to_s, unrecognized_args(&block : String -> ) unrecognized_args

Constructor methods inherited from class Phreak::Subparser

new(parent : Subparser | Nil) new

Constructor Detail

def self.new(args : Array(String)) #

[View source]

Instance Method Detail

def default(&block : Proc(Void)) #

Yields to a callback if Phreak::parse is called with no arguments.


[View source]
def next_token : String | Nil #

Returns the next token, if available. Will raise an exception if @args.size == 0


[View source]
def token_available? : Bool #

Returns true if there is at least one token remaining to be parsed.


[View source]