From c451c482580342d4779a3c5054382d3f02c251d3 Mon Sep 17 00:00:00 2001 From: Rodrigo Aguilera Date: Tue, 29 Sep 2020 17:50:06 +0200 Subject: [PATCH] [Console] Improve description for the help flag. --- src/Symfony/Component/Console/Application.php | 3 +-- .../Console/Tests/Command/ListCommandTest.php | 2 +- .../Console/Tests/Fixtures/application_1.json | 4 ++-- .../Console/Tests/Fixtures/application_1.md | 4 ++-- .../Console/Tests/Fixtures/application_1.txt | 2 +- .../Console/Tests/Fixtures/application_1.xml | 4 ++-- .../Console/Tests/Fixtures/application_2.json | 12 ++++++------ .../Console/Tests/Fixtures/application_2.md | 10 +++++----- .../Console/Tests/Fixtures/application_2.txt | 2 +- .../Console/Tests/Fixtures/application_2.xml | 12 ++++++------ .../Fixtures/application_filtered_namespace.txt | 2 +- .../Console/Tests/Fixtures/application_mbstring.md | 6 +++--- .../Console/Tests/Fixtures/application_mbstring.txt | 2 +- .../Console/Tests/Fixtures/application_run1.txt | 2 +- .../Console/Tests/Fixtures/application_run2.txt | 2 +- .../Console/Tests/Fixtures/application_run3.txt | 2 +- .../Console/Tests/Fixtures/application_run5.txt | 2 +- .../Tests/phpt/single_application/help_name.phpt | 2 +- 18 files changed, 37 insertions(+), 38 deletions(-) diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index 86c4d7fd6a..79217013ee 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -1020,8 +1020,7 @@ class Application implements ResetInterface { return new InputDefinition([ new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), - - new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message'), + new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display help for the given command. When no command is given display help for the '.$this->defaultCommand.' command'), new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message'), new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'), diff --git a/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php b/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php index 3908ca5bb2..a5d6653ad8 100644 --- a/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php +++ b/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php @@ -77,7 +77,7 @@ Usage: command [options] [arguments] Options: - -h, --help Display this help message + -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 Force ANSI output diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_1.json b/src/Symfony/Component/Console/Tests/Fixtures/application_1.json index f069ad0090..8e676346e3 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_1.json +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_1.json @@ -43,7 +43,7 @@ "accept_value": false, "is_value_required": false, "is_multiple": false, - "description": "Display this help message", + "description": "Display help for the given command. When no command is given display help for the list command", "default": false }, "quiet": { @@ -146,7 +146,7 @@ "accept_value": false, "is_value_required": false, "is_multiple": false, - "description": "Display this help message", + "description": "Display help for the given command. When no command is given display help for the list command", "default": false }, "quiet": { diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_1.md b/src/Symfony/Component/Console/Tests/Fixtures/application_1.md index a67a4f18f0..f168f58a22 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_1.md +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_1.md @@ -55,7 +55,7 @@ To output raw command help #### `--help|-h` -Display this help message +Display help for the given command. When no command is given display help for the list command * Accept value: no * Is value required: no @@ -173,7 +173,7 @@ The output format (txt, xml, json, or md) #### `--help|-h` -Display this help message +Display help for the given command. When no command is given display help for the list command * Accept value: no * Is value required: no diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_1.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_1.txt index 8a7b47e0c4..cc55447241 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_1.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_1.txt @@ -4,7 +4,7 @@ Console Tool command [options] [arguments] Options: - -h, --help Display this help message + -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 Force ANSI output diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_1.xml b/src/Symfony/Component/Console/Tests/Fixtures/application_1.xml index b190fd1092..55061a1504 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_1.xml +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_1.xml @@ -34,7 +34,7 @@ To output raw command help