Skip to content

Commit d2c08e9

Browse files
authored
Merge branch 'master' into dartdoc-0.27.0
2 parents bfd292f + 9a0212a commit d2c08e9

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

bin/dartdoc.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ Future<void> main(List<String> arguments) async {
120120
/// Print help if we are passed the help option.
121121
void _printHelp(ArgParser parser) {
122122
print('Generate HTML documentation for Dart libraries.\n');
123+
print(parser.usage);
123124
}
124125

125126
/// Print usage information on invalid command lines.

test/dartdoc_test.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,13 @@ void main() {
152152
throwsA(const TypeMatcher<ProcessException>()));
153153
});
154154

155+
test('help prints command line args', () async {
156+
List<String> outputLines = [];
157+
await subprocessLauncher.runStreamed(Platform.resolvedExecutable, [dartdocPath, '--help'], perLine: outputLines.add);
158+
expect(outputLines, contains('Generate HTML documentation for Dart libraries.'));
159+
expect(outputLines.join('\n'), contains(new RegExp('^-h, --help[ ]+Show command help.', multiLine: true))) ;
160+
});
161+
155162
test('Validate missing FLUTTER_ROOT exception is clean', () async {
156163
StringBuffer output = new StringBuffer();
157164
var args = <String>[dartdocPath];

0 commit comments

Comments
 (0)