const EVENT_FLAG
pub const EVENT_FLAG = 0Purpose
Constant EVENT_FLAG, defining protocol or algorithm parameters.
#flagFlagSet with no globals: define_* + parse + print_defaults.
const EVENT_FLAGpub const EVENT_FLAG = 0Constant EVENT_FLAG, defining protocol or algorithm parameters.
const EVENT_ARGpub const EVENT_ARG = 1Constant EVENT_ARG, defining protocol or algorithm parameters.
const EVENT_UNKNOWNpub const EVENT_UNKNOWN = 2Constant EVENT_UNKNOWN, defining protocol or algorithm parameters.
struct Eventpub struct Event {
pub kind int
pub name string
pub raw string
pub value string
}Structure encapsulating kind, name, raw, value.
kind intname stringraw stringvalue stringstruct Setpub struct Set {
pub name string
pub names []string
pub kinds []int
pub bs []bool
pub ss []string
pub ins []int
pub fs []f64
pub durs []int
pub usages []string
pub set_flags []bool
pub rest []string
pub parsed bool
pub alias_keys []string
pub alias_targets []string
pub allow_slash_mode bool
pub sl_flag_idx []int
pub sl_vals []string
pub events []Event
pub unknowns []string
pub allow_unknown_mode bool
pub allow_colon_fallback_mode bool
}Structure encapsulating name, names, kinds, bs, ss.
name stringnames []stringkinds []intbs []boolss []stringins []intfs []f64durs []intusages []stringset_flags []boolrest []stringparsed boolalias_keys []stringalias_targets []stringallow_slash_mode boolsl_flag_idx []intsl_vals []stringevents []Eventunknowns []stringallow_unknown_mode boolallow_colon_fallback_mode boolnew_setpub fn new_set(name string) SetConstruct set.
name stringSet — a value of this type
($&Set) allow_slashpub fn (s $&Set) allow_slash(enable bool)allow_slash enables Windows-style '/' option prefix parsing (e.g. /?, /S).
s $&SetSet instance used by this call (exclusive borrow).enable boolThis call does not return a value.
($&Set) allow_unknownpub fn (s $&Set) allow_unknown(enable bool)allow_unknown records unknown flags instead of returning an error.
s $&SetSet instance used by this call (exclusive borrow).enable boolThis call does not return a value.
($&Set) allow_colon_fallbackpub fn (s $&Set) allow_colon_fallback(enable bool)allow_colon_fallback enables prefix matching across ':' specifiers (e.g. -c:v:0 -> -c:v -> -c).
s $&SetSet instance used by this call (exclusive borrow).enable boolThis call does not return a value.
($&Set) aliaspub fn (s $&Set) alias(short_name string, canonical_name string)alias registers an alternative option name pointing to an existing canonical flag.
s $&SetSet instance used by this call (exclusive borrow).short_name stringcanonical_name stringThis call does not return a value.
($&Set) define_boolpub fn (s $&Set) define_bool(name string, def bool, usage string)Operation on $&Set: define bool.
s $&SetSet instance used by this call (exclusive borrow).name stringdef boolusage stringThis call does not return a value.
($&Set) define_stringpub fn (s $&Set) define_string(name string, def string, usage string)Operation on $&Set: define string.
s $&SetSet instance used by this call (exclusive borrow).name stringdef stringusage stringThis call does not return a value.
($&Set) define_intpub fn (s $&Set) define_int(name string, def int, usage string)Operation on $&Set: define int.
s $&SetSet instance used by this call (exclusive borrow).name stringdef intusage stringThis call does not return a value.
($&Set) define_float64pub fn (s $&Set) define_float64(name string, def f64, usage string)Operation on $&Set: define float64.
s $&SetSet instance used by this call (exclusive borrow).name stringdef f64usage stringThis call does not return a value.
($&Set) define_durationpub fn (s $&Set) define_duration(name string, def int, usage string)Operation on $&Set: define duration.
s $&SetSet instance used by this call (exclusive borrow).name stringdef intusage stringThis call does not return a value.
($&Set) define_string_listpub fn (s $&Set) define_string_list(name string, usage string)Operation on $&Set: define string list.
s $&SetSet instance used by this call (exclusive borrow).name stringusage stringThis call does not return a value.
($&Set) define_bool_aliaspub fn (s $&Set) define_bool_alias(name string, short_name string, def bool, usage string)Convenience definition methods with an alias
s $&SetSet instance used by this call (exclusive borrow).name stringshort_name stringdef boolusage stringThis call does not return a value.
($&Set) define_string_aliaspub fn (s $&Set) define_string_alias(name string, short_name string, def string, usage string)Operation on $&Set: define string alias.
s $&SetSet instance used by this call (exclusive borrow).name stringshort_name stringdef stringusage stringThis call does not return a value.
($&Set) define_int_aliaspub fn (s $&Set) define_int_alias(name string, short_name string, def int, usage string)Operation on $&Set: define int alias.
s $&SetSet instance used by this call (exclusive borrow).name stringshort_name stringdef intusage stringThis call does not return a value.
($&Set) define_float64_aliaspub fn (s $&Set) define_float64_alias(name string, short_name string, def f64, usage string)Operation on $&Set: define float64 alias.
s $&SetSet instance used by this call (exclusive borrow).name stringshort_name stringdef f64usage stringThis call does not return a value.
($&Set) define_string_list_aliaspub fn (s $&Set) define_string_list_alias(name string, short_name string, usage string)Operation on $&Set: define string list alias.
s $&SetSet instance used by this call (exclusive borrow).name stringshort_name stringusage stringThis call does not return a value.
(&Set) get_stringspub fn (s &Set) get_strings(name string) []stringOperation on &Set: read strings.
s &SetSet instance used by this call (borrow).name string[]string — slice result
(&Set) unknown_flagspub fn (s &Set) unknown_flags() []stringOperation on &Set: unknown flags.
s &SetSet instance used by this call (borrow).[]string — slice result
(&Set) event_listpub fn (s &Set) event_list() []EventOperation on &Set: event list.
s &SetSet instance used by this call (borrow).[]Event — slice result
(&Set) is_setpub fn (s &Set) is_set(name string) boolOperation on &Set: whether it is set.
s &SetSet instance used by this call (borrow).name stringbool — true or false
(&Set) get_boolpub fn (s &Set) get_bool(name string) boolOperation on &Set: read bool.
s &SetSet instance used by this call (borrow).name stringbool — true or false
(&Set) get_stringpub fn (s &Set) get_string(name string) stringOperation on &Set: read string.
s &SetSet instance used by this call (borrow).name stringstring — result string
(&Set) get_intpub fn (s &Set) get_int(name string) intOperation on &Set: read int.
s &SetSet instance used by this call (borrow).name stringint — a value of this type
(&Set) get_float64pub fn (s &Set) get_float64(name string) f64Operation on &Set: read float64.
s &SetSet instance used by this call (borrow).name stringf64 — a value of this type
(&Set) get_durationpub fn (s &Set) get_duration(name string) intOperation on &Set: read duration.
s &SetSet instance used by this call (borrow).name stringint — a value of this type
(&Set) get_bool_orpub fn (s &Set) get_bool_or(name string, def bool) boolFallback getters: return specified default value when flag was not explicitly provided on CLI
s &SetSet instance used by this call (borrow).name stringdef boolbool — true or false
(&Set) get_string_orpub fn (s &Set) get_string_or(name string, def string) stringOperation on &Set: read string or.
s &SetSet instance used by this call (borrow).name stringdef stringstring — result string
(&Set) get_int_orpub fn (s &Set) get_int_or(name string, def int) intOperation on &Set: read int or.
s &SetSet instance used by this call (borrow).name stringdef intint — a value of this type
(&Set) get_float64_orpub fn (s &Set) get_float64_or(name string, def f64) f64Operation on &Set: read float64 or.
s &SetSet instance used by this call (borrow).name stringdef f64f64 — a value of this type
(&Set) get_duration_orpub fn (s &Set) get_duration_or(name string, def int) intOperation on &Set: read duration or.
s &SetSet instance used by this call (borrow).name stringdef intint — a value of this type
(&Set) print_defaultspub fn (s &Set) print_defaults()Operation on &Set: print defaults.
s &SetSet instance used by this call (borrow).This call does not return a value.
(&Set) argspub fn (s &Set) args() []stringOperation on &Set: return the command-line argument slice.
s &SetSet instance used by this call (borrow).[]string — slice result
($&Set) parsepub fn (s $&Set) parse(args []string) intparse consumes args ( FlagSet.Parse shape); returns 0 on success. Positional arguments are kept in the set. May >> errors.Error. Throws on failure; handle the error or propagate it to the caller.
s $&SetSet instance used by this call (exclusive borrow).args []stringint — a value of this type
($&Set) parse_frompub fn (s $&Set) parse_from(args &[]string, start int) intOperation on $&Set: parse as from. Throws on failure; handle the error or propagate it to the caller.
s $&SetSet instance used by this call (exclusive borrow).args &[]stringstart intint — a value of this type
(&Set) nflagpub fn (s &Set) nflag() intExecute nflag on &Set.
s &SetSet instance used by this call (borrow).int — a value of this type
($&Set) setpub fn (s $&Set) set(name string, value string) intExecute set on $&Set. Throws on failure; handle the error or propagate it to the caller.
s $&SetSet instance used by this call (exclusive borrow).name stringvalue stringint — a value of this type
(&Set) visitpub fn (s &Set) visit() []stringExecute visit on &Set.
s &SetSet instance used by this call (borrow).[]string — slice result
struct Flagpub struct Flag {
pub name string
pub usage string
pub is_set bool
pub found bool
}Structure encapsulating name, usage, is_set, found.
name stringusage stringis_set boolfound bool(&Set) lookuppub fn (s &Set) lookup(name string) FlagOperation on &Set: look up matching key or item in index or collection.
s &SetSet instance used by this call (borrow).name stringFlag — a value of this type
(&Set) nargpub fn (s &Set) narg() intExecute narg on &Set.
s &SetSet instance used by this call (borrow).int — a value of this type
(&Set) parsedpub fn (s &Set) parsed() boolExecute parsed on &Set.
s &SetSet instance used by this call (borrow).bool — true or false
(&Set) argpub fn (s &Set) arg(i int) stringExecute arg on &Set.
s &SetSet instance used by this call (borrow).i intstring — result string
(&Set) visit_allpub fn (s &Set) visit_all() []stringOperation on &Set: visit all.
s &SetSet instance used by this call (borrow).[]string — slice result