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

Show usage help for the command that failed #1453

Closed
munificent opened this issue Sep 28, 2016 · 1 comment
Closed

Show usage help for the command that failed #1453

munificent opened this issue Sep 28, 2016 · 1 comment
Labels
type-enhancement A request for a change that isn't a bug

Comments

@munificent
Copy link
Member

If the user enters a bad option or flag for a command, but the command itself is valid, the usage help should be for that command. Right now, if you do:

$ pub get --bloof

You get:

Could not find an option named "bloof".

Usage: pub <command> [arguments]

Global options:
-h, --help             Print this usage information.
    --version          Print pub version.
    --[no-]trace       Print debugging information when an error occurs.
    --verbosity        Control output verbosity.

          [all]        Show all output including internal tracing messages.
          [error]      Show only errors.
          [io]         Also show IO operations.
          [normal]     Show errors, warnings, and user messages.
          [solver]     Show steps during version resolution.
          [warning]    Show only errors and warnings.

-v, --verbose          Shortcut for "--verbosity=all".

Available commands:
  build       Apply transformers to build a package.
  cache       Work with the system cache.
  deps        Print package dependencies.
  downgrade   Downgrade the current package's dependencies to oldest versions.
  get         Get the current package's dependencies.
  global      Work with global packages.
  help        Display help information for pub.
  publish     Publish the current package to pub.dartlang.org.
  run         Run an executable from a package.
  serve       Run a local web development server.
  upgrade     Upgrade the current package's dependencies to latest versions.
  uploader    Manage uploaders for a package on pub.dartlang.org.
  version     Print pub version.

Run "pub help <command>" for more information about a command.
See http://dartlang.org/tools/pub for detailed documentation.

It would be better as:

Could not find an option named "bloof".

Usage: pub get
-h, --help                 Print this usage information.
    --[no-]offline         Use cached packages instead of accessing the network.
-n, --dry-run              Report what dependencies would change but don't change any.
    --[no-]precompile      Precompile executables and transformed dependencies.
                           (defaults to on)

    --[no-]packages-dir    Generate a packages/ directory when installing packages.
                           (defaults to on)

Run "pub help" to see global options.
See http://dartlang.org/tools/pub/cmd/pub-get.html for detailed documentation.
@munificent munificent added the type-enhancement A request for a change that isn't a bug label Sep 28, 2016
@nex3
Copy link
Member

nex3 commented Sep 30, 2016

This issue was moved to dart-lang/args#52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

2 participants