Skip to content

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
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
Contributor

@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
@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 [email protected] tool/web: tiniest tweak to wasm help content (flutter/flutter#126284)
2023-05-08 [email protected] Roll Flutter Engine from d9184ce4ffa0 to 8d3a8162b3ab (7 revisions) (flutter/flutter#126288)
2023-05-08 [email protected] Fix that `flutter test` does not understand `concurrency` (flutter/flutter#125942)
2023-05-08 [email protected] Fix that `flutter test` does not understand `concurrency` (flutter/flutter#125942)
2023-05-08 [email protected] Improve the format in `asset_bundle.dart` (flutter/flutter#126229)
2023-05-08 [email protected] Tiny cleanup for Navigator code (without introducing dependency) (flutter/flutter#125628)
2023-05-08 [email protected]  [Refactor] Fix style in example (flutter/flutter#126191)
2023-05-08 [email protected] Roll Flutter Engine from a8e9ac63fd95 to d9184ce4ffa0 (2 revisions) (flutter/flutter#126279)
2023-05-08 [email protected] [Tool] Output help on 'flutter pub' (flutter/flutter#126211)
2023-05-08 [email protected] Always use `--concurrency=1` for web tests. (flutter/flutter#126179)
2023-05-08 [email protected] Add `--verbose` flags for flakey tests (flutter/flutter#126162)
2023-05-08 [email protected] Roll Packages from a0f8fd8 to 4800d65 (2 revisions) (flutter/flutter#126269)
2023-05-08 [email protected] 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 [email protected],[email protected],[email protected] 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
flutter/flutter@4ed1c92...8c5a1ea

2023-05-08 [email protected] tool/web: tiniest tweak to wasm help content (flutter/flutter#126284)
2023-05-08 [email protected] Roll Flutter Engine from d9184ce4ffa0 to 8d3a8162b3ab (7 revisions) (flutter/flutter#126288)
2023-05-08 [email protected] Fix that `flutter test` does not understand `concurrency` (flutter/flutter#125942)
2023-05-08 [email protected] Fix that `flutter test` does not understand `concurrency` (flutter/flutter#125942)
2023-05-08 [email protected] Improve the format in `asset_bundle.dart` (flutter/flutter#126229)
2023-05-08 [email protected] Tiny cleanup for Navigator code (without introducing dependency) (flutter/flutter#125628)
2023-05-08 [email protected]  [Refactor] Fix style in example (flutter/flutter#126191)
2023-05-08 [email protected] Roll Flutter Engine from a8e9ac63fd95 to d9184ce4ffa0 (2 revisions) (flutter/flutter#126279)
2023-05-08 [email protected] [Tool] Output help on 'flutter pub' (flutter/flutter#126211)
2023-05-08 [email protected] Always use `--concurrency=1` for web tests. (flutter/flutter#126179)
2023-05-08 [email protected] Add `--verbose` flags for flakey tests (flutter/flutter#126162)
2023-05-08 [email protected] Roll Packages from a0f8fd8 to 4800d65 (2 revisions) (flutter/flutter#126269)
2023-05-08 [email protected] 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 [email protected],[email protected],[email protected] 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.

2 participants