cli/args_helpers library

Functions

fmtBytes(int bytes) String
Formats bytes as a human-readable string with one decimal place.
parsePointList(String raw) List<(double, double)>?
Parses a semicolon-separated list of "x,y" coordinate pairs into a list of (double, double) tuples, or returns null if malformed or fewer than 2 points are present.
parseXY(String raw) → (double, double)?
Parses an "x,y" coordinate string into a (double, double) tuple, or returns null if the input is malformed.
runCliAdapter(ArgParser parser, List<String> args, Future<int> execute(ArgResults)) Future<int>
Runs a CLI adapter end-to-end:
runSimpleCliAdapter(List<String> args, Future<int> execute(List<String>), {String helpText = 'No options for this command.'}) Future<int>
Runs a CLI adapter that accepts no options. Skips ArgParser construction entirely; just intercepts --help/-h and otherwise calls execute with the raw args (allowing the executor to inspect positional arguments).