Commit f91c965
committed
feature #47750 [Console] Show available commands in namespace when running namespace as command (wouterj)
This PR was merged into the 6.2 branch.
Discussion
----------
[Console] Show available commands in namespace when running namespace as command
| Q | A
| ------------- | ---
| Branch? | 6.2
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | n/a
Another little UX improvement found in the Docker CLI: When running the namespace as a command (e.g. `bin/console make`), instead of showing an error "this command does not exist", show the list of sub-commands in that namespace.
I've kept the exit code and dispatching of the error event in place, to avoid any BC breaks on this matter.
**Before**
```
$ bin/console debug
Command "debug" is not defined.
Did you mean one of these?
debug:autowiring
debug:config
debug:container
debug:dotenv
debug:event-dispatcher
debug:router
```
**After**
```
$ bin/console debug
Symfony 6.2.0-DEV (env: dev, debug: true) #StandWithUkraine https://sf.to/ukraine
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
-e, --env=ENV The Environment name. [default: "dev"]
--no-debug Switch off debug mode.
-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 "debug" namespace:
debug:autowiring List classes/interfaces you can use for autowiring
debug:config Dump the current configuration for an extension
debug:container Display current services for an application
debug:dotenv Lists all dotenv files with variables and values
debug:event-dispatcher Display configured listeners for an application
debug:router Display current routes for an application
```
Commits
-------
912ecd8 Show available commands in namespace when running namespace as commandFile tree
2 files changed
+49
-18
lines changed- src/Symfony/Component/Console
- Tests
2 files changed
+49
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
259 | 260 | | |
260 | 261 | | |
261 | 262 | | |
262 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
263 | 281 | | |
264 | 282 | | |
265 | 283 | | |
| |||
271 | 289 | | |
272 | 290 | | |
273 | 291 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
287 | 306 | | |
288 | | - | |
289 | | - | |
290 | 307 | | |
291 | | - | |
292 | | - | |
293 | 308 | | |
294 | 309 | | |
295 | 310 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
558 | 574 | | |
559 | 575 | | |
560 | 576 | | |
| |||
0 commit comments