invocation property

String get invocation

A single-line template for how to invoke this command (e.g. "pub get package").

Implementation

String get invocation {
  var parents = [name];
  for (var command = parent; command != null; command = command.parent) {
    parents.add(command.name);
  }
  parents.add(runner!.executableName);

  var invocation = parents.reversed.join(' ');
  return _subcommands.isNotEmpty
      ? '$invocation <subcommand> [arguments]'
      : '$invocation [arguments]';
}