Skip to content

[Console] Improve description for the help flag. #38347

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

Closed

Conversation

rodrigoaguilera
Copy link

Q A
Branch? master
Bug fix? no
New feature? no
Deprecations? no
Tickets no
License MIT

I am currently trying to improve a CLI tool called robo (https://robo.li) that relies heavily on the console component.
First thing I did was running it without any argument like ./robo to find the description for the help flag -h or --help
"Display this help message"
This is typical for any CLI tool out there except that when I run ./robo --help I get the help for the list command (same output as robo help list).

One of the options I considered was to fix this behavior by showing the same output when no command is given disregarding the help flag (just for the case of no command given) but I actually like how symfony console handles the help flag.
I think it needs a clarification for the description given so I changed it to:

Display help for the given command. When no command is given display help for the list command

Which is more descriptive about what actually happens in the code when that flag is given. Specially the "this" word can be a little confusing.

@fabpot
Copy link
Member

fabpot commented Sep 30, 2020

Thank you @rodrigoaguilera.

fabpot added a commit that referenced this pull request Sep 30, 2020
…oaguilera)

This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Console] Improve description for the help flag.

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | no
| License       | MIT

I am currently trying to improve a CLI tool called `robo` (https://robo.li) that relies heavily on the console component.
First thing I did was running it without any argument like `./robo` to find the description for the help flag `-h` or `--help`
"Display this help message"
This is typical for any CLI tool out there except that when I run `./robo --help` I get the help for the `list` command (same output as `robo help list`).

One of the options I considered was to fix this behavior by showing the same output when no command is given disregarding the help flag (just for the case of no command given) but I actually like how symfony console handles the help flag.
I think it needs a clarification for the description given so I changed it to:

> Display help for the given command. When no command is given display help for the list command

Which is more descriptive about what actually happens in the code when that flag is given. Specially the "this" word can be a little confusing.

Commits
-------

c451c48 [Console] Improve description for the help flag.
@fabpot fabpot closed this Sep 30, 2020
fabpot added a commit that referenced this pull request Oct 4, 2020
…odrigoaguilera)

This PR was merged into the 5.2-dev branch.

Discussion
----------

[Console] Remove "php" invokation from help messages.

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| License       | MIT

Discusstion started here:
#38349

I was a bit puzzled to find that the help for the list and help commands suggests that you call the console application by prefixing it with `php myconsoleapp`.

As suggested in the PR above I am removing the `php ` prefix from the help.

I am providing a script with a shebang like the first example suggested in the following link:
https://symfony.com/doc/current/components/console.html
Eventually I want to distribute my console app as docker image so there is no need for php installed or the users even knowing is written in php.
The script name is easy to override by just setting a different value to `$_SERVER['PHP_SELF']` but this php prefix is hardcoded into the help strings for the the two default commands available.

Slightly related to #38347 as I am trying to improve the console help output.

Commits
-------

e036c30 [Console] Remove "php" invokation from help messages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants