Skip to content

Commit

Permalink
Fix exit-code-threshold help text and reorganize code to match (#1374)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexios80 authored Jun 19, 2024
1 parent 2658e6b commit 1f5e495
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Usage: pana [<options>] --hosted <published package name> [<version>]
Options:
--dart-sdk The directory of the Dart SDK.
--flutter-sdk The directory of the Flutter SDK.
--exit-code-threshold The exit code will indicate if (max - granted points) <= threshold.
--exit-code-threshold The exit code will indicate if (max - granted points) > threshold.
-j, --json Output log records and full report as JSON.
--hosted-url The server that hosts <package>.
(defaults to "https://pub.dev")
Expand Down
6 changes: 3 additions & 3 deletions bin/pana.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ final _parser = ArgParser()
)
..addOption('exit-code-threshold',
help:
'The exit code will indicate if (max - granted points) <= threshold.')
'The exit code will indicate if (max - granted points) > threshold.')
..addFlag('json',
abbr: 'j',
help: 'Output log records and full report as JSON.',
Expand Down Expand Up @@ -266,8 +266,8 @@ Future<void> main(List<String> args) async {
}
if (exitCodeThreshold != null &&
exitCodeThreshold >= 0 &&
exitCodeThreshold + summary.report!.grantedPoints <
summary.report!.maxPoints) {
summary.report!.maxPoints - summary.report!.grantedPoints >
exitCodeThreshold) {
exitCode = 127;
}
} catch (e, stack) {
Expand Down
2 changes: 1 addition & 1 deletion test/goldens/help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Usage: pana [<options>] --hosted <published package name> [<version>]
Options:
--dart-sdk The directory of the Dart SDK.
--flutter-sdk The directory of the Flutter SDK.
--exit-code-threshold The exit code will indicate if (max - granted points) <= threshold.
--exit-code-threshold The exit code will indicate if (max - granted points) > threshold.
-j, --json Output log records and full report as JSON.
--hosted-url The server that hosts <package>.
(defaults to "https://pub.dev")
Expand Down

0 comments on commit 1f5e495

Please sign in to comment.