From 8bd3649f182f59f91041334118386224faef7156 Mon Sep 17 00:00:00 2001 From: "Fabien C. Y. Benureau" Date: Sat, 5 Jan 2019 23:19:25 +0900 Subject: [PATCH] check that all arguments are optional when no config --- pubs/pubs_cmd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pubs/pubs_cmd.py b/pubs/pubs_cmd.py index 033880e..6da78f2 100644 --- a/pubs/pubs_cmd.py +++ b/pubs/pubs_cmd.py @@ -60,7 +60,8 @@ def execute(raw_args=sys.argv): # an update happened, reload conf. conf = config.load_conf(path=conf_path) except config.ConfigurationNotFound: - if len(remaining_args) == 0 or remaining_args[0] == 'init' or remaining_args[0][0] == '-': + if (len(remaining_args) == 0 or remaining_args[0] == 'init' + or all(arg[0] == '-' for arg in remaining_args)): # only optional arguments conf = config.load_default_conf() conf.filename = conf_path else: