addFormatOption method
void
addFormatOption()
Adds the --format option.
In the kFormatJson mode a command prints a single JSON object
in the standard output, all other messages go to the error output.
Implementation
void addFormatOption() => addOption(
kFormat,
help: 'Output format.',
allowed: const [kFormatText, kFormatJson],
allowedHelp: const {
kFormatText: 'Human readable output.',
kFormatJson: 'Single JSON object in stdout '
'(all other messages go to stderr).',
},
defaultsTo: kFormatText,
);