argParser property

  1. @override
ArgParser get argParser
override

The argument parser for this command.

Options for this command should be registered with this parser (often in the constructor); they'll end up available via argResults. Subcommands should be registered with addSubcommand rather than directly on the parser.

This can be overridden to change the arguments passed to the ArgParser constructor.

Implementation

@override
ArgParser get argParser => ArgParser()
  ..addOption(
    'config',
    abbr: 'c',
    help: 'Path to the configuration file.',
    defaultsTo: 'distribution.yaml',
  )
  ..addOption(
    'from',
    help: 'Start of the range, exclusive. Defaults to the previous tag.',
  )
  ..addOption(
    'to',
    help: 'End of the range, inclusive.',
    defaultsTo: 'HEAD',
  )
  ..addOption(
    'format',
    abbr: 'f',
    allowed: ['markdown', 'plain'],
    help: 'How to render the notes.',
    allowedHelp: {
      'markdown': 'Headed sections and bullets, for a GitHub release.',
      'plain': 'A flat bullet list, for stores that show plain text.',
    },
  )
  ..addFlag(
    'group',
    defaultsTo: true,
    help: 'Group markdown output by conventional commit type.',
  )
  ..addFlag(
    'shas',
    negatable: false,
    defaultsTo: false,
    help: 'Append the short commit hash to every line.',
  )
  ..addOption(
    'limit',
    help: 'Stop after this many commits.',
  )
  ..addFlag(
    'merges',
    negatable: false,
    defaultsTo: false,
    help: 'Include merge commits.',
  )
  ..addFlag(
    'ai',
    negatable: false,
    defaultsTo: false,
    help: 'Rewrite the notes with the configured model before printing.',
  )
  ..addOption(
    'output',
    abbr: 'o',
    help: 'Write to this file instead of stdout.',
  );