parser property

ArgParser parser
getter/setter pair

Command-line argument parser for GitHub Releases publisher.

Defines all supported command-line options for the GitHub publisher with their descriptions, types, defaults, and validation rules. Used for parsing user input and generating help documentation.

Includes comprehensive options for:

  • File paths and upload targets
  • Repository identification
  • Authentication and security
  • Release management
  • Content and metadata

Implementation

static ArgParser parser = ArgParser()
  ..addOption(
    'file-path',
    abbr: 'f',
    help: 'The path to the file to upload',
    mandatory: true,
  )
  ..addOption(
    'token',
    help: 'The token to use for github authentication.',
    mandatory: true,
  )
  ..addOption(
    'repo-name',
    help: 'The name of the repository to upload the file to.',
    mandatory: true,
  )
  ..addOption(
    'repo-owner',
    help: 'The owner of the repository to upload the file to.',
    mandatory: true,
  )
  ..addOption(
    'release-name',
    help:
        'The release name (also used as the git tag) to upload the file to.',
    mandatory: true,
  )
  ..addOption(
    'release-body',
    help: 'The release body to upload the file to.',
  )
  ..addOption(
    'binary-type',
    abbr: 'b',
    help:
        'Only upload files with this extension when file-path is a directory. '
        'Leave empty to upload every file.',
    defaultsTo: '',
  )
  ..addFlag(
    'draft',
    negatable: false,
    defaultsTo: false,
    help: 'Create the release as an unpublished draft.',
  )
  ..addFlag(
    'prerelease',
    negatable: false,
    defaultsTo: false,
    help: 'Mark the release as a pre-release.',
  )
  ..addOption(
    'target-commitish',
    help: 'Branch or commit SHA the release tag is created from.',
  );