mirror of
https://github.com/certbot/certbot.git
synced 2026-06-08 16:22:18 -04:00
Raising error on conflicting args
This commit is contained in:
parent
87d0e938ad
commit
8772a9846f
2 changed files with 11 additions and 1 deletions
|
|
@ -669,6 +669,16 @@ def main(cli_args=sys.argv[1:]):
|
|||
|
||||
sys.excepthook = functools.partial(_handle_exception, config=config)
|
||||
|
||||
# Avoid conflicting args
|
||||
conficting_args = ["quiet", "noninteractive_mode", "text_mode"]
|
||||
if config.dialog_mode:
|
||||
for arg in conficting_args:
|
||||
if getattr(config, arg):
|
||||
raise errors.Error(
|
||||
("Conflicting values for displayer."
|
||||
" {0} conflicts with dialog_mode").format(arg)
|
||||
)
|
||||
|
||||
# Displayer
|
||||
if config.quiet:
|
||||
config.noninteractive_mode = True
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class CLITest(unittest.TestCase): # pylint: disable=too-many-public-methods
|
|||
self.logs_dir = os.path.join(self.tmp_dir, 'logs')
|
||||
self.standard_args = ['--config-dir', self.config_dir,
|
||||
'--work-dir', self.work_dir,
|
||||
'--logs-dir', self.logs_dir, '--text']
|
||||
'--logs-dir', self.logs_dir]
|
||||
|
||||
def tearDown(self):
|
||||
shutil.rmtree(self.tmp_dir)
|
||||
|
|
|
|||
Loading…
Reference in a new issue