addGlobalOptions static method

void addGlobalOptions(
  1. ArgParser parser
)

Adds the global options every command shares to parser.

Implementation

static void addGlobalOptions(ArgParser parser) {
  parser
    ..addOption(
      'server',
      abbr: 's',
      help:
          'Base URL of the OmnyStore server '
          '(default: \$OMNYSTORE_URL).',
      valueHelp: 'url',
    )
    ..addOption(
      'token',
      abbr: 't',
      help:
          'Bearer token for authentication '
          '(default: \$OMNYSTORE_TOKEN). Prefer the environment variable: a '
          'token on the command line is visible to every user on the '
          'machine.',
      valueHelp: 'token',
    )
    ..addOption(
      'data',
      abbr: 'd',
      help:
          'Run against a local registry directory instead of a server '
          '(default: \$OMNYSTORE_DATA).',
      valueHelp: 'dir',
    )
    ..addFlag(
      'json',
      help: 'Emit JSON instead of human-readable text.',
      negatable: false,
    )
    ..addFlag(
      'quiet',
      abbr: 'q',
      help: 'Suppress progress output.',
      negatable: false,
    )
    ..addFlag(
      'verbose',
      abbr: 'v',
      help: 'Log what the CLI and server are doing.',
      negatable: false,
    )
    ..addFlag(
      'version',
      abbr: 'V',
      help: 'Print the omnystore version and exit.',
      negatable: false,
    );
}