parser property

ArgParser parser
getter/setter pair

Command-line argument parser for Xcrun publisher.

Defines all supported command-line options for the Xcrun 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 IPA targets
  • Authentication methods
  • App Store Connect configuration
  • Validation and upload controls
  • Bundle and version management
  • Platform-specific settings

Implementation

static ArgParser parser = ArgParser()
  ..addOption(
    'file-path',
    abbr: 'f',
    help: 'Path to the file to upload',
    mandatory: true,
  )
  ..addOption(
    'username',
    abbr: 'u',
    help: 'Username for validation and upload',
  )
  ..addOption(
    'password',
    abbr: 'p',
    help:
        'Password for authentication. Can be plaintext, keychain, or environment variable',
  )
  ..addOption('api-key', help: 'API key for JWT authentication')
  ..addOption('api-issuer', help: 'Issuer ID for JWT authentication')
  ..addOption('apple-id', help: 'Apple ID of the app package')
  ..addOption('bundle-version', help: 'Bundle version of the app package')
  ..addOption(
    'bundle-short-version-string',
    help: 'Short version string of the app package',
  )
  ..addOption(
    'asc-public-id',
    help: 'Public ID for accounts with multiple providers',
  )
  ..addOption(
    'type',
    help: 'Platform type (e.g., macos, ios, appletvos, visionos)',
  )
  ..addFlag(
    'validate-app',
    negatable: false,
    help: 'Validates the app archive for the App Store',
  )
  ..addOption('upload-package', help: 'Path to the app archive for upload')
  ..addOption(
    'bundle-id',
    help: 'Bundle ID of the app',
    defaultsTo: BuildInfo.iosBundleId,
  )
  ..addOption('product-id', help: 'Product ID for hosted content')
  ..addOption('sku', help: 'SKU for hosted content')
  ..addOption(
    'output-format',
    help: 'Output format (e.g., xml, json, normal)',
  );