Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tool] Output help on 'flutter pub' #126211

Merged
merged 1 commit into from May 8, 2023
Merged

Conversation

loic-sharma
Copy link
Member

@loic-sharma loic-sharma commented May 6, 2023

This change makes flutter pub show the help usage:

PS > flutter pub
Commands for managing Flutter packages.

Global options:
-h, --help                  Print this usage information.
-v, --verbose               Noisy logging, including all shell commands executed.
                            If used with "--help", shows hidden options. If used with "flutter
                            doctor", shows additional diagnostic information. (Use "-vv" to force
                            verbose logging in those cases.)
-d, --device-id             Target device id or name (prefixes allowed).
    --version               Reports the version of this tool.
    --suppress-analytics    Suppress analytics reporting for the current CLI invocation.
    --disable-telemetry     Disable telemetry reporting when this command runs.

Usage: flutter pub <subcommand> [arguments]
-h, --help    Print this usage information.

Available subcommands:
  add         Add a dependency to pubspec.yaml.
  cache       Work with the Pub system cache.
  deps        Print package dependencies.
  downgrade   Downgrade packages in a Flutter project.
  get         Get the current package's dependencies.
  global      Work with Pub global packages.
  login       Log into pub.dev.
  logout      Log out of pub.dev.
  outdated    Analyze dependencies to find which ones can be upgraded.
  pub         Pass the remaining arguments to Dart's "pub" tool.
  publish     Publish the current package to pub.dartlang.org.
  remove      Removes a dependency from the current package.
  run         Run an executable from a package.
  test        Run the "test" package.
  token       Manage authentication tokens for hosted pub repositories.
  upgrade     Upgrade the current package's dependencies to latest versions.
  uploader    Manage uploaders for a package on pub.dev.
  version     Print Pub version.

Run "flutter help" to see global options.

Previously it showed an error message:

PS > flutter pub
Missing subcommand for "flutter pub".


Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.

Addresses #110025

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label May 6, 2023
@loic-sharma loic-sharma marked this pull request as ready for review May 7, 2023 00:17
@@ -54,6 +62,9 @@ class PackagesCommand extends FlutterCommand {

@override
Future<FlutterCommandResult> runCommand() async => FlutterCommandResult.fail();

@override
void printUsage() => _usagePrintFn(usage);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is inspired by the custom devices command, which also bypasses arg's direct use of print by overriding printUsage.

@loic-sharma loic-sharma changed the title [Tool] Show usage on 'flutter pub' [Tool] Output help on 'flutter pub' May 7, 2023
Copy link
Member

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@loic-sharma loic-sharma added the autosubmit Merge PR when tree becomes green via auto submit App label May 8, 2023
@auto-submit auto-submit bot merged commit 472a0ab into flutter:master May 8, 2023
121 checks passed
@loic-sharma loic-sharma deleted the pub_usage branch May 8, 2023 22:22
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 9, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request May 9, 2023
flutter/flutter@4ed1c92...8c5a1ea

2023-05-08 kevmoo@users.noreply.github.com tool/web: tiniest tweak to wasm help content (flutter/flutter#126284)
2023-05-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from d9184ce4ffa0 to 8d3a8162b3ab (7 revisions) (flutter/flutter#126288)
2023-05-08 5236035+fzyzcjy@users.noreply.github.com Fix that `flutter test` does not understand `concurrency` (flutter/flutter#125942)
2023-05-08 5236035+fzyzcjy@users.noreply.github.com Fix that `flutter test` does not understand `concurrency` (flutter/flutter#125942)
2023-05-08 github@alexv525.com Improve the format in `asset_bundle.dart` (flutter/flutter#126229)
2023-05-08 5236035+fzyzcjy@users.noreply.github.com Tiny cleanup for Navigator code (without introducing dependency) (flutter/flutter#125628)
2023-05-08 50433979+negotoyolo@users.noreply.github.com  [Refactor] Fix style in example (flutter/flutter#126191)
2023-05-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from a8e9ac63fd95 to d9184ce4ffa0 (2 revisions) (flutter/flutter#126279)
2023-05-08 737941+loic-sharma@users.noreply.github.com [Tool] Output help on 'flutter pub' (flutter/flutter#126211)
2023-05-08 jacksongardner@google.com Always use `--concurrency=1` for web tests. (flutter/flutter#126179)
2023-05-08 42216813+eliasyishak@users.noreply.github.com Add `--verbose` flags for flakey tests (flutter/flutter#126162)
2023-05-08 engine-flutter-autoroll@skia.org Roll Packages from a0f8fd8 to 4800d65 (2 revisions) (flutter/flutter#126269)
2023-05-08 reidbaker@google.com Test AGP 8.0 using java 17 (flutter/flutter#125323)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC camillesimon@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
nploi pushed a commit to nploi/packages that referenced this pull request Jul 16, 2023
…r#3949)

flutter/flutter@4ed1c92...8c5a1ea

2023-05-08 kevmoo@users.noreply.github.com tool/web: tiniest tweak to wasm help content (flutter/flutter#126284)
2023-05-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from d9184ce4ffa0 to 8d3a8162b3ab (7 revisions) (flutter/flutter#126288)
2023-05-08 5236035+fzyzcjy@users.noreply.github.com Fix that `flutter test` does not understand `concurrency` (flutter/flutter#125942)
2023-05-08 5236035+fzyzcjy@users.noreply.github.com Fix that `flutter test` does not understand `concurrency` (flutter/flutter#125942)
2023-05-08 github@alexv525.com Improve the format in `asset_bundle.dart` (flutter/flutter#126229)
2023-05-08 5236035+fzyzcjy@users.noreply.github.com Tiny cleanup for Navigator code (without introducing dependency) (flutter/flutter#125628)
2023-05-08 50433979+negotoyolo@users.noreply.github.com  [Refactor] Fix style in example (flutter/flutter#126191)
2023-05-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from a8e9ac63fd95 to d9184ce4ffa0 (2 revisions) (flutter/flutter#126279)
2023-05-08 737941+loic-sharma@users.noreply.github.com [Tool] Output help on 'flutter pub' (flutter/flutter#126211)
2023-05-08 jacksongardner@google.com Always use `--concurrency=1` for web tests. (flutter/flutter#126179)
2023-05-08 42216813+eliasyishak@users.noreply.github.com Add `--verbose` flags for flakey tests (flutter/flutter#126162)
2023-05-08 engine-flutter-autoroll@skia.org Roll Packages from a0f8fd8 to 4800d65 (2 revisions) (flutter/flutter#126269)
2023-05-08 reidbaker@google.com Test AGP 8.0 using java 17 (flutter/flutter#125323)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC camillesimon@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants