diff --git a/avocado/plugins/list.py b/avocado/plugins/list.py index e542c38d87b0b04f0492d1a38b0dda2330e6603f..84d3ae58d9acb90237f7422e400155f69d877fea 100644 --- a/avocado/plugins/list.py +++ b/avocado/plugins/list.py @@ -20,6 +20,7 @@ from avocado.core import test from avocado.core import tags from avocado.core import parser_common_args from avocado.core.output import LOG_UI +from avocado.core.future.settings import settings from avocado.core.plugin_interfaces import CLICmd from avocado.utils import astring @@ -122,7 +123,7 @@ class TestLister: def _list(self): self._extra_listing() - test_suite = self._get_test_suite(self.args.get('references', [])) + test_suite = self._get_test_suite(self.args.get('list.references')) if self.args.get('filter_by_tags', False): test_suite = tags.filter_test_tags( test_suite, @@ -157,15 +158,20 @@ class List(CLICmd): :type parser: :class:`avocado.core.parser.ArgumentParser` """ parser = super(List, self).configure(parser) - parser.add_argument('references', type=str, default=[], nargs='*', - help="List of test references (aliases or paths). " - "If empty, avocado will list tests on " - "the configured test source, " - "(see 'avocado config --datadir') Also, " - "if there are other test loader plugins " - "active, tests from those plugins might " - "also show up (behavior may vary among " - "plugins)") + help_msg = ('List of test references (aliases or paths). If empty, ' + 'Avocado will list tests on the configured test source, ' + '(see "avocado config --datadir") Also, if there are ' + 'other test loader plugins active, tests from those ' + 'plugins might also show up (behavior may vary among ' + 'plugins)') + settings.register_option(section='list', + key='references', + default=[], + nargs='*', + key_type=list, + help_msg=help_msg, + parser=parser, + positional_arg=True) loader.add_loader_options(parser) parser_common_args.add_tag_filter_args(parser)