| Index: runtime/observatory/lib/src/cli/command.dart
|
| diff --git a/runtime/observatory/lib/src/cli/command.dart b/runtime/observatory/lib/src/cli/command.dart
|
| index b015bac2cd90bb8c562436cd053568b26d362154..ce16a643666f0fe7b540504f19aaf30bda1a7aef 100644
|
| --- a/runtime/observatory/lib/src/cli/command.dart
|
| +++ b/runtime/observatory/lib/src/cli/command.dart
|
| @@ -164,6 +164,16 @@ class RootCommand extends _CommandBase {
|
| }
|
| }
|
|
|
| + // Find all matching commands. Useful for implementing help systems.
|
| + List<Command> matchCommand(List<String> args, bool preferExact) {
|
| + if (args.isEmpty) {
|
| + // Adding an empty string to the end causes us to match all
|
| + // subcommands of the last command.
|
| + args.add('');
|
| + }
|
| + return _match(args, preferExact);
|
| + }
|
| +
|
| Future run(List<String> args) {
|
| throw 'should-not-execute-the-root-command';
|
| }
|
| @@ -175,7 +185,14 @@ class RootCommand extends _CommandBase {
|
| abstract class Command extends _CommandBase {
|
| Command(this.name, List<Command> children) : super(children);
|
|
|
| - final name;
|
| + final String name;
|
| + String get fullName {
|
| + if (_parent is RootCommand) {
|
| + return name;
|
| + } else {
|
| + return '${_parent.fullName} $name';
|
| + }
|
| + }
|
|
|
| toString() => 'Command(${name})';
|
| }
|
|
|