diff --git a/ansible_galaxy/actions/list.py b/ansible_galaxy/actions/list.py index 4a81fe05..7bcb1a5e 100644 --- a/ansible_galaxy/actions/list.py +++ b/ansible_galaxy/actions/list.py @@ -162,6 +162,7 @@ def list_action(galaxy_context, list_content=False, lockfile_format=False, lockfile_freeze=False, + fully_qualified=False, output_format=None, display_callback=None): '''Run _list action and return an exit code suitable for process exit''' @@ -171,8 +172,8 @@ def list_action(galaxy_context, output_format = OutputFormat.LOCKFILE if lockfile_freeze: output_format = OutputFormat.LOCKFILE_FREEZE - - output_format = OutputFormat.FULLY_QUALIFIED + if fully_qualified: + output_format = OutputFormat.FULLY_QUALIFIED _list(galaxy_context, repository_spec_match_filter=repository_spec_match_filter, diff --git a/ansible_galaxy_cli/cli/galaxy.py b/ansible_galaxy_cli/cli/galaxy.py index 57865011..664d0e02 100644 --- a/ansible_galaxy_cli/cli/galaxy.py +++ b/ansible_galaxy_cli/cli/galaxy.py @@ -115,6 +115,8 @@ def set_action(self): help="List installed collections in collections lockfile format") self.parser.add_option('--freeze', dest='list_lockfile_freeze', default=False, action='store_true', help="List installed collections in collections lockfile format with frozen versions") + self.parser.add_option('--full', dest='list_fully_qualified', default=False, action='store_true', + help="List installed collections using fully qualifed names as used in playbooks") elif self.action == "version": self.parser.set_usage("usage: %prog version") @@ -355,6 +357,7 @@ def execute_list(self): list_content=list_content, lockfile_format=self.options.list_lockfile_format, lockfile_freeze=self.options.list_lockfile_freeze, + fully_qualified=self.options.list_fully_qualified, display_callback=self.display) def execute_version(self):