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

Fix #2574: Suggest alternative spelling when a command is mistyped #2593

Merged
merged 7 commits into from
Feb 13, 2023

Conversation

elvodqa
Copy link
Contributor

@elvodqa elvodqa commented Feb 13, 2023

Suggesting similar command names

Suggesting similar command names
@WebFreak001
Copy link
Member

WebFreak001 commented Feb 13, 2023

problem: unknown commands should not print the whole usage, only a shortened version

e.g. right now it does:

       Error Unknown command: upfrade
             Did you mean 'upgrade'?

USAGE: dub [--version] [<command>] [<options...>] [-- [<application arguments...>]]

Manages the DUB project in the current directory. If the command is omitted,
DUB will default to "run". When running an application, "--" can be used to
separate DUB options from options passed to the application.

Run "dub <command> --help" to get help for a specific command.

You can use the "http_proxy" environment variable to configure a proxy server
to be used for fetching packages.


Available commands
==================

  Package creation
  ----------------
  init [<directory> [<dependency>...]]
                        Initializes an empty package skeleton

  Build, test and run
...

but this would be better:

USAGE: dub [--version] [<command>] [<options...>] [-- [<application arguments...>]]

       Error Unknown command: upfrade
             Did you mean 'upgrade'?

@WebFreak001
Copy link
Member

can you add USAGE: dub [--version] [<command>] [<options...>] [-- [<application arguments...>]] at the top of the output? (using logInfoNoTag)

@Geod24 Geod24 changed the title Fix #2574 Fix #2574: Suggest alternative spelling when a command is mistyped Feb 13, 2023
@Geod24 Geod24 enabled auto-merge (squash) February 13, 2023 12:49
@Geod24 Geod24 disabled auto-merge February 13, 2023 12:49
@Geod24 Geod24 merged commit 5c1e5dc into dlang:master Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants