VyuhCliCommandRunner constructor

VyuhCliCommandRunner({
  1. Logger? logger,
  2. PubUpdater? pubUpdater,
})

A CommandRunner for the CLI.

$ vyuh --version

Implementation

VyuhCliCommandRunner({
  Logger? logger,
  PubUpdater? pubUpdater,
})  : _logger = logger ?? Logger(),
      _pubUpdater = pubUpdater ?? PubUpdater(),
      super(executableName, description) {
  // Add root options and flags
  argParser
    ..addFlag(
      'version',
      abbr: 'v',
      negatable: false,
      help: 'Print the current version.',
    )
    ..addFlag(
      'verbose',
      help: 'Noisy logging, including all shell commands executed.',
    );

  // Add sub commands
  addCommand(CreateCommand(logger: _logger));
  addCommand(UpdateCommand(logger: _logger, pubUpdater: _pubUpdater));
}