class Optimist::BoolOpt

Overview

Flag option. Has no arguments. Can be negated with "no-". Allows multiple of the same option to be given if multi: is given.

Defined in:

optimist/option.cr

Constructors

Instance Method Summary

Instance methods inherited from class Optimist::Option

add_argument_value(a : Array(String), b : Bool) add_argument_value, default default, desc : String desc, description_with_default(str) description_with_default, description_with_permitted(str) description_with_permitted, disallow_multiple_args(paramlist : Array(String)) disallow_multiple_args, doesnt_need_autogen_short doesnt_need_autogen_short, educate educate, format_stdio(obj) format_stdio, full_description full_description, given? : Bool given?, long : Optimist::LongNames long, max_args : Int32 max_args, min_args : Int32 min_args, name : String name, needs_an_argument needs_an_argument, permitted : Array(Int32) | Array(String) | Range(Int32, Int32) | Regex | Nil permitted, permitted_response : String permitted_response, permitted_type_valid? permitted_type_valid?, permitted_value?(val : DefaultType) : Bool permitted_value?, required? : Bool required?, short : Optimist::ShortNames short, takes_an_argument takes_an_argument, takes_multiple takes_multiple, trigger_callback trigger_callback, type_format type_format, validate_permitted(arg : String, value : DefaultType) : Void validate_permitted, value value

Constructor methods inherited from class Optimist::Option

new(name : String, desc : String, default : T, long : LongNameType = nil, alt : AlternatesType = nil, short : ShortNameType = nil, permitted : PermittedType = nil, callback : Option -> Nil | Nil = nil, permitted_response : String = "option '%{arg}' only accepts %{valid_string}", required : Bool = false, hidden : Bool = false, multi : Bool | Nil = nil) forall T new

Class methods inherited from class Optimist::Option

create(name : String, desc : String, cls : Class | Nil = nil, default : _ = nil, **kwargs) create

Constructor Detail

def self.new(name, desc, default : Bool | Nil = nil, **kwargs) #

[View source]

Instance Method Detail

def add_argument_value(_paramlist : Array(String), neg_given) #

[View source]
def counter : Int32 #

[View source]
def counter=(counter : Int32) #

[View source]
def default : Bool #

[View source]
def multi : Bool? #

[View source]
def multi=(multi) #

[View source]
def needs_an_argument #

[View source]
def takes_an_argument #

[View source]
def takes_multiple : Bool? #

[View source]
def value #

[View source]
def value=(value : Bool | Nil) #

[View source]