class Argy::FlagSet

Overview

FlagSet holds a named collection of flags and knows how to parse argv tokens. Each Command has two FlagSets: one for local flags and one for persistent flags.

Defined in:

argy/flag_set.cr

Instance Method Summary

Instance Method Detail

def bool(name : String, shorthand : Char | Nil, default : Bool, usage : String) : BoolFlag #

[View source]
def each(&block : Flag -> ) : Nil #

Iterate over every registered flag


[View source]
def empty? : Bool #

[View source]
def float(name : String, shorthand : Char | Nil, default : Float64, usage : String) : Float64Flag #

[View source]
def int(name : String, shorthand : Char | Nil, default : Int32, usage : String) : IntFlag #

[View source]
def lookup(name : String) : Flag | Nil #

[View source]
def lookup_shorthand(ch : Char) : Flag | Nil #

[View source]
def parse(args : Array(String), remaining : Array(String), extra : Hash(String, Flag) = {} of String => Flag, ignore_unknown : Bool = false) : Nil #

[View source]
def reset! : Nil #

[View source]
def string(name : String, shorthand : Char | Nil, default : String, usage : String) : StringFlag #

[View source]