ShellBinCommand constructor

ShellBinCommand({
  1. required String name,
  2. Version? version,
  3. ArgParser? parser,
  4. ShellBinCommand? parent,
  5. String? description,
})

Shell bin command

Implementation

ShellBinCommand(
    {required this.name,
    Version? version,
    ArgParser? parser,
    ShellBinCommand? parent,
    String? description}) {
  //_onRun = onRun;
  _parser = parser;
  _description = description;
  _version = version;
  // read or create
  parser = this.parser;
  // Add missing common commands
  if (parent == null) {
    parser.addFlag(flagVersion,
        help: 'Print the command version', negatable: false);
    parser.addFlag(flagVerbose,
        abbr: 'v', help: 'Verbose mode', negatable: false);
  }
  parser.addFlag(flagHelp, abbr: 'h', help: 'Usage help', negatable: false);
}