invocation property

String invocation

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

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]';
}