未验证 提交 444d6914 编写于 作者: R Rudá Moura

avocado app: Review command line option regarding the paginator.

Use `--paginator {on,off}` instead of `--disable-paginator`.
It is on by default, set `--paginator=off` to disable it.
Signed-off-by: NRudá Moura <rmoura@redhat.com>
上级 5cf5736d
......@@ -30,15 +30,15 @@ class PluginList(plugin.Plugin):
self.parser = parser.subcommands.add_parser(
'plugins',
help='List all plugins loaded')
self.parser.add_argument('--disable-paginator',
dest='disable_paginator',
action='store_true',
help='Disable paginator usage')
self.parser.add_argument('--paginator',
choices=('on', 'off'), default='on',
help='Turn the paginator on/off. '
'Current: %(default)s')
super(PluginList, self).configure(self.parser)
def run(self, args):
view = output.View(app_args=args,
use_paginator=not args.disable_paginator)
use_paginator=args.paginator == 'on')
pm = get_plugin_manager()
view.notify(event='message', msg='Plugins loaded:')
blength = 0
......
......@@ -54,10 +54,10 @@ class TestList(plugin.Plugin):
help='Whether to show extra information '
'(headers and summary). Current: %('
'default)s')
self.parser.add_argument('--disable-paginator',
dest='disable_paginator',
action='store_true',
help='Disable paginator usage')
self.parser.add_argument('--paginator',
choices=('on', 'off'), default='on',
help='Turn the paginator on/off. '
'Current: %(default)s')
super(TestList, self).configure(self.parser)
def _run(self, args):
......@@ -67,7 +67,7 @@ class TestList(plugin.Plugin):
:param args: Command line args received from the list subparser.
"""
self.view = output.View(app_args=args,
use_paginator=not args.disable_paginator)
use_paginator=args.paginator == 'on')
paths = [data_dir.get_test_dir()]
if args.paths:
......
......@@ -70,8 +70,8 @@ class RemoteTestRunner(TestRunner):
urls_str = " ".join(urls)
avocado_check_urls_cmd = ('cd %s; avocado list %s '
'--disable-paginator' % (self.remote_test_dir,
urls_str))
'--paginator=off' % (self.remote_test_dir,
urls_str))
check_urls_result = self.result.remote.run(avocado_check_urls_cmd,
ignore_status=True,
timeout=None)
......
......@@ -41,7 +41,7 @@ class RemoteTestRunnerTest(unittest.TestCase):
.with_args(args, ignore_status=True, timeout=None)
.once().and_return(version_result))
args = 'cd ~/avocado/tests; avocado list sleeptest --disable-paginator'
args = 'cd ~/avocado/tests; avocado list sleeptest --paginator=off'
urls_result = flexmock(exit_status=0)
(Remote.should_receive('run')
.with_args(args, timeout=None, ignore_status=True)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册