Skip to content

[Console] Show Application-level console options when showing synopsis or when error occurred #47436

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

Open
wants to merge 11 commits into
base: 7.4
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
Fix expected output of failing tests
  • Loading branch information
jlslew committed Sep 2, 2022
commit 61232ee7fa7a6122088c76f7b3a58240057fdc4c
184 changes: 114 additions & 70 deletions src/Symfony/Component/Console/Tests/Fixtures/application_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@
"description": "Internal command to provide shell completion suggestions",
"help": "Internal command to provide shell completion suggestions",
"definition": {
"arguments": [],
"options": {
"symfony": {
"name": "--symfony",
"shortcut": "-S",
"accept_value": true,
"is_value_required": true,
"is_multiple": false,
"description": "deprecated",
"default": null
},
"application-level arguments": {
"command": {
"name": "command",
"is_required": true,
"is_array": false,
"description": "The command to execute",
"default": ""
}
},
"application-level options": {
"help": {
"name": "--help",
"shortcut": "-h",
Expand Down Expand Up @@ -82,7 +81,10 @@
"is_multiple": false,
"description": "Do not ask any interactive question",
"default": false
},
}
},
"command-level arguments": [],
"command-level options": {
"shell": {
"name": "--shell",
"shortcut": "-s",
Expand Down Expand Up @@ -118,6 +120,15 @@
"is_multiple": false,
"description": "The API version of the completion script",
"default": null
},
"symfony": {
"name": "--symfony",
"shortcut": "-S",
"accept_value": true,
"is_value_required": true,
"is_multiple": false,
"description": "deprecated",
"default": null
}
}
}
Expand All @@ -131,16 +142,16 @@
"description": "Dump the shell completion script",
"help": "Dump the shell completion script",
"definition": {
"arguments": {
"shell": {
"name": "shell",
"is_required": false,
"application-level arguments": {
"command": {
"name": "command",
"is_required": true,
"is_array": false,
"description": "The shell type (e.g. \"bash\"), the value of the \"$SHELL\" env var will be used if this is not given",
"default": null
"description": "The command to execute",
"default": ""
}
},
"options": {
"application-level options": {
"help": {
"name": "--help",
"shortcut": "-h",
Expand Down Expand Up @@ -203,7 +214,18 @@
"is_multiple": false,
"description": "Do not ask any interactive question",
"default": false
},
}
},
"command-level arguments": {
"shell": {
"name": "shell",
"is_required": false,
"is_array": false,
"description": "The shell type (e.g. \"bash\"), the value of the \"$SHELL\" env var will be used if this is not given",
"default": null
}
},
"command-level options": {
"debug": {
"name": "--debug",
"shortcut": "",
Expand All @@ -225,34 +247,16 @@
"description": "Display help for a command",
"help": "The <info>help<\/info> command displays help for a given command:\n\n <info>%%PHP_SELF%% help list<\/info>\n\nYou can also output the help in other formats by using the <comment>--format<\/comment> option:\n\n <info>%%PHP_SELF%% help --format=xml list<\/info>\n\nTo display the list of available commands, please use the <info>list<\/info> command.",
"definition": {
"arguments": {
"command_name": {
"name": "command_name",
"is_required": false,
"application-level arguments": {
"command": {
"name": "command",
"is_required": true,
"is_array": false,
"description": "The command name",
"default": "help"
"description": "The command to execute",
"default": ""
}
},
"options": {
"format": {
"name": "--format",
"shortcut": "",
"accept_value": true,
"is_value_required": true,
"is_multiple": false,
"description": "The output format (txt, xml, json, or md)",
"default": "txt"
},
"raw": {
"name": "--raw",
"shortcut": "",
"accept_value": false,
"is_value_required": false,
"is_multiple": false,
"description": "To output raw command help",
"default": false
},
"application-level options": {
"help": {
"name": "--help",
"shortcut": "-h",
Expand Down Expand Up @@ -316,6 +320,35 @@
"description": "Do not ask any interactive question",
"default": false
}
},
"command-level arguments": {
"command_name": {
"name": "command_name",
"is_required": false,
"is_array": false,
"description": "The command name",
"default": "help"
}
},
"command-level options": {
"format": {
"name": "--format",
"shortcut": "",
"accept_value": true,
"is_value_required": true,
"is_multiple": false,
"description": "The output format (txt, xml, json, or md)",
"default": "txt"
},
"raw": {
"name": "--raw",
"shortcut": "",
"accept_value": false,
"is_value_required": false,
"is_multiple": false,
"description": "To output raw command help",
"default": false
}
}
}
},
Expand All @@ -328,34 +361,16 @@
"description": "List commands",
"help": "The <info>list<\/info> command lists all commands:\n\n <info>%%PHP_SELF%% list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n <info>%%PHP_SELF%% list test<\/info>\n\nYou can also output the information in other formats by using the <comment>--format<\/comment> option:\n\n <info>%%PHP_SELF%% list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n <info>%%PHP_SELF%% list --raw<\/info>",
"definition": {
"arguments": {
"namespace": {
"name": "namespace",
"is_required": false,
"application-level arguments": {
"command": {
"name": "command",
"is_required": true,
"is_array": false,
"description": "The namespace name",
"default": null
"description": "The command to execute",
"default": ""
}
},
"options": {
"raw": {
"name": "--raw",
"shortcut": "",
"accept_value": false,
"is_value_required": false,
"is_multiple": false,
"description": "To output raw command list",
"default": false
},
"format": {
"name": "--format",
"shortcut": "",
"accept_value": true,
"is_value_required": true,
"is_multiple": false,
"description": "The output format (txt, xml, json, or md)",
"default": "txt"
},
"application-level options": {
"help": {
"name": "--help",
"shortcut": "-h",
Expand Down Expand Up @@ -418,6 +433,35 @@
"is_multiple": false,
"description": "Do not ask any interactive question",
"default": false
}
},
"command-level arguments": {
"namespace": {
"name": "namespace",
"is_required": false,
"is_array": false,
"description": "The namespace name",
"default": null
}
},
"command-level options": {
"raw": {
"name": "--raw",
"shortcut": "",
"accept_value": false,
"is_value_required": false,
"is_multiple": false,
"description": "To output raw command list",
"default": false
},
"format": {
"name": "--format",
"shortcut": "",
"accept_value": true,
"is_value_required": true,
"is_multiple": false,
"description": "The output format (txt, xml, json, or md)",
"default": "txt"
},
"short": {
"name": "--short",
Expand Down
Loading