From 6f7ed85844c8842743228a5afb9163c7642225aa Mon Sep 17 00:00:00 2001 From: Amjad Mashaal Date: Wed, 25 May 2016 00:17:47 +0200 Subject: [PATCH 1/3] -v implies --text --- certbot/cli.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/certbot/cli.py b/certbot/cli.py index 35b3b74ae..244d321d8 100644 --- a/certbot/cli.py +++ b/certbot/cli.py @@ -392,6 +392,11 @@ class HelpfulArgumentParser(object): ("Conflicting values for displayer." " {0} conflicts with dialog_mode").format(arg) ) + else: + # -v should imply --text + if (parsed_args.verbose_count > flag_default("verbose_count") and + not parsed_args.dialog_mode): + parsed_args.text_mode = True if parsed_args.validate_hooks: hooks.validate_hooks(parsed_args) From cf73511ae746f128b867fa9164736645dcef93b0 Mon Sep 17 00:00:00 2001 From: Amjad Mashaal Date: Thu, 14 Jul 2016 13:06:35 +0200 Subject: [PATCH 2/3] Fixing styling issues --- certbot/cli.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/certbot/cli.py b/certbot/cli.py index 244d321d8..1bd339f99 100644 --- a/certbot/cli.py +++ b/certbot/cli.py @@ -392,11 +392,8 @@ class HelpfulArgumentParser(object): ("Conflicting values for displayer." " {0} conflicts with dialog_mode").format(arg) ) - else: - # -v should imply --text - if (parsed_args.verbose_count > flag_default("verbose_count") and - not parsed_args.dialog_mode): - parsed_args.text_mode = True + elif parsed_args.verbose_count > flag_default("verbose_count"): + parsed_args.text_mode = True if parsed_args.validate_hooks: hooks.validate_hooks(parsed_args) From 754719125b84715a259be49bb9eb02662864a193 Mon Sep 17 00:00:00 2001 From: Amjad Mashaal Date: Sat, 16 Jul 2016 01:18:46 +0200 Subject: [PATCH 3/3] Adding test for text_mode when verbose is enabled --- certbot/tests/cli_test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/certbot/tests/cli_test.py b/certbot/tests/cli_test.py index 896550837..cb32975e4 100644 --- a/certbot/tests/cli_test.py +++ b/certbot/tests/cli_test.py @@ -1020,6 +1020,12 @@ class CLITest(unittest.TestCase): # pylint: disable=too-many-public-methods args = ['renew', '--dialog', '--text'] self.assertRaises(errors.Error, self._call, args) + def test_text_mode_when_verbose(self): + parse = self._get_argument_parser() + short_args = ['-v'] + namespace = parse(short_args) + self.assertTrue(namespace.text_mode) + class DetermineAccountTest(unittest.TestCase): """Tests for certbot.cli._determine_account."""