athena-framework / athena

An ecosystem of reusable, independent components
https://athenaframework.org
MIT License
211 stars 17 forks source link

Improve output when using a namespace as a command name #427

Closed Blacksmoke16 closed 3 months ago

Blacksmoke16 commented 3 months ago

Context

Previously if you were to try an execute a command that is the name of a namespace you'd get output like:

  Command 'foo' is not defined.

  Did you mean one of these?
      afoobar
      afoobar1
      afoobar2
      foo1:bar
      foo:bar
      foo:bar1

Which isn't all that helpful. This PR makes it better handle this context by displaying the commands in that namespace:

MyCLI 1.2.3

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display help for the given command. When no command is given display help for the list command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands for the 'foo' namespace:
  foo:bar   [afoobar] The foo:bar command
  foo:bar1  [afoobar1] The foo:bar1 command

Changelog