NatrixFlag<T> class abstract

Typed command-line flag.

Concrete implementations are used to define flags for NatrixCommand definitions. Flags are matched during pipeline traversal via their id (long form: --id) or their acronym (short form: -a).

Implementers
Annotations
  • @immutable

Constructors

NatrixFlag({required String id, NatrixChar? acronym, required T value, List<T> examples = const [], String tooltip = ""})
const

Properties

acronym → NatrixChar?
Optional single-character shorthand for the flag, used as short-form syntax in command-line arguments (-a where a is the acronym character). Must be unique within a command's flag set.
final
examples → List<T>
Optional list of example values for help output generation.
final
hasAcronym → bool
no setter
hashCode → int
The hash code for this object.
no setteroverride
id → String
Unique identifier for the flag, used as long-form syntax in command-line arguments (--id).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tooltip → String
Brief description displayed in help output.
final
value → T
Current and/or initial value of the flag.
final

Methods

format(T value) → String
Formats a value of type T as a string for output or serialization.
getExamplesFormatted() → List<String>
Returns formatted string representations of all examples.
getFormatted() → String
Returns the formatted string representation of the current value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(String raw) → T
Parses a raw string from command-line arguments into type T.
set(T value) → NatrixFlag<T>
Returns a new instance of this flag with the specified value.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override