mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 10:51:53 +02:00
Adding --dialog argument
This commit is contained in:
@@ -569,6 +569,9 @@ def prepare_and_parse_args(plugins, args, detect_defaults=False):
|
||||
help="Run without ever asking for user input. This may require "
|
||||
"additional command line flags; the client will try to explain "
|
||||
"which ones are required if it finds one missing")
|
||||
helpful.add(
|
||||
None, "--dialog", dest="dialog_mode", action="store_true",
|
||||
help="Run using dialog")
|
||||
helpful.add(
|
||||
None, "--dry-run", action="store_true", dest="dry_run",
|
||||
help="Perform a test run of the client, obtaining test (invalid) certs"
|
||||
|
||||
+2
-1
@@ -677,8 +677,9 @@ def main(cli_args=sys.argv[1:]):
|
||||
displayer = display_util.NoninteractiveDisplay(sys.stdout)
|
||||
elif config.text_mode:
|
||||
displayer = display_util.FileDisplay(sys.stdout)
|
||||
elif config.dialog_mode:
|
||||
displayer = display_util.NcursesDisplay()
|
||||
elif config.verb == "renew":
|
||||
config.noninteractive_mode = True
|
||||
displayer = display_util.NoninteractiveDisplay(sys.stdout)
|
||||
else:
|
||||
displayer = display_util.NcursesDisplay()
|
||||
|
||||
@@ -149,6 +149,12 @@ class CLITest(unittest.TestCase): # pylint: disable=too-many-public-methods
|
||||
args.extend(['--email', 'io@io.is'])
|
||||
self._cli_missing_flag(args, "--agree-tos")
|
||||
|
||||
@mock.patch('certbot.main.renew')
|
||||
def test_gui(self, renew):
|
||||
args = ['renew', '--dialog']
|
||||
self._call(args)
|
||||
self.assertFalse(renew.call_args[0][0].noninteractive_mode)
|
||||
|
||||
@mock.patch('certbot.main.client.acme_client.Client')
|
||||
@mock.patch('certbot.main._determine_account')
|
||||
@mock.patch('certbot.main.client.Client.obtain_and_enroll_certificate')
|
||||
|
||||
Reference in New Issue
Block a user