unstable library Null safety

A set of APIs without any guaranteed stability at the moment, designed for advanced usage.

Classes

Arg<T>
A holder for the eventual value of an argument.
ArgumentDefinition<T, U>
ArgumentSet
CommandDefinition
CommandSetDefinition<T>
DefaultUsagePrinter
A default implementation of UsagePrinter.
Definition
FixedTerminalAttributes
A derivative of TerminalAttributes that uses ahead-of-time fixed values.
Flag
OptionArgumentDefinition<T, U>
PositionalArgumentDefinition<T, U>
Requires<U>
A representation of the requirement state of an argument. Can mandate that the argument is mandatory or optional (with a default).
TerminalAttributes
A set of attributes that a sink backed by a terminal may have.
UsageContext
A list of all nested commands that have been parsed, i.e. given myapp a b, the list will contain a and b.
UsageGroup
A group that arguments can be associated with, so that the arguments will be grouped under this group's name in the usage text.
UsageInfo
A set of information that should be printed on the program's usage text.
ValueHolder<T>
A holder for an eventual value given on the command line.
ValueTarget<T>

Constants

disableFlagInverse → const String
Can be passed to the inverse argument of ArgParser flag methods to disable the inverse completely. See ArgParser.addMultiFlag for more information.
''

Functions

defaultTerminalAttributesFactory(StringSink sink) TerminalAttributes
A default TerminalAttributesFactory that will determine the proper terminal attributes if the sink is indeed a terminal, otherwise it uses the defaults in FixedTerminalAttributes.defaults.
defaultTextWrapper(String text, int width) List<String>
A default TextWrapper that wraps on word boundaries (determined by the presence of spaces), using character wrapping as a fallback.

Typedefs

TerminalAttributesFactory = TerminalAttributes Function(StringSink sink)
A function that takes in a sink and returns the TerminalAttributes that should be associated with the sink.
TextWrapper = List<String> Function(String text, int width)
A "wrapper" for text, taking in some text and a line width and returning a list of lines for the wrapped text.
UsagePrinter = void Function(ArgumentSet args, UsageInfo info, UsageContext context, {required bool showShortUsage, required StringSink sink})
A function that prints usage information to the given sink. If showShortUsage is true, then this should only show a short "usage: " section, otherwise it should show the full help.