Updated CLI help for 'ansible-galaxy' for 'collection' subcommand (#69458)
* Added YAML header line and link to existing github issue
This commit is contained in:
parent
4dd0f41270
commit
187de7a8aa
2 changed files with 9 additions and 1 deletions
3
changelogs/fragments/69458-updated-galaxy-cli-help.yaml
Normal file
3
changelogs/fragments/69458-updated-galaxy-cli-help.yaml
Normal file
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
bugfixes:
|
||||
- "ansible-galaxy- On giving an invalid subcommand to ansible-galaxy, the help would be shown only for role subcommand (collection subcommand help is not shown). With this change, the entire help for ansible-galaxy (same as ansible-galaxy --help) is displayed along with the help for role subcommand. (https://github.com/ansible/ansible/issues/69009)"
|
|
@ -372,7 +372,12 @@ class CLI(with_metaclass(ABCMeta, object)):
|
|||
if HAS_ARGCOMPLETE:
|
||||
argcomplete.autocomplete(self.parser)
|
||||
|
||||
options = self.parser.parse_args(self.args[1:])
|
||||
try:
|
||||
options = self.parser.parse_args(self.args[1:])
|
||||
except SystemExit as e:
|
||||
if(e.code != 0):
|
||||
self.parser.exit(status=2, message=" \n%s " % self.parser.format_help())
|
||||
raise
|
||||
options = self.post_process_args(options)
|
||||
context._init_global_context(options)
|
||||
|
||||
|
|
Loading…
Reference in a new issue