Skip to content

Commit

Permalink
feat: improve create command usage (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
felangel committed Feb 22, 2021
1 parent c3ca589 commit b728b21
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ Global options:
[true] Enable anonymous usage statistics

Available commands:
create Creates a new very good flutter application in seconds.
create very_good create <output directory>
Creates a new very good flutter project in the specified directory.

Run "very_good help <command>" for more information about a command.
```
Expand Down
12 changes: 9 additions & 3 deletions lib/src/commands/create.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,17 @@ class CreateCommand extends Command<int> {
final Future<MasonGenerator> Function(MasonBundle) _generator;

@override
final String description =
'Creates a new very good flutter application in seconds.';
String get description =>
'Creates a new very good flutter project in the specified directory.';

@override
final String name = 'create';
String get summary => '$invocation\n$description';

@override
String get name => 'create';

@override
String get invocation => 'very_good create <output directory>';

/// [ArgResults] which can be overridden for testing.
@visibleForTesting
Expand Down
3 changes: 2 additions & 1 deletion test/src/command_runner_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const expectedUsage = [
' [true] Enable anonymous usage statistics\n'
'\n'
'Available commands:\n'
' create Creates a new very good flutter application in seconds.\n'
' create very_good create <output directory>\n'
''' Creates a new very good flutter project in the specified directory.\n'''
'\n'
'Run "very_good help <command>" for more information about a command.'
];
Expand Down

0 comments on commit b728b21

Please sign in to comment.