addHelpOption method

void addHelpOption({
  1. String name = 'help',
  2. String? short = 'h',
  3. String description = 'Show this help',
  4. StringSink? sink,
})

Adds a help option to this parser that prints the usage.

Implementation

void addHelpOption(
    {String name = 'help',
    String? short = 'h',
    String description = 'Show this help',
    StringSink? sink}) {
  addFlag(name, short: short, description: description, onParse: (_) {
    findSelectedParser().printUsage(sink: sink, showShortUsage: false);
    exit(0);
  });
}