From c20bafb73ff38787d6db18026eaf3d0f20ee69b8 Mon Sep 17 00:00:00 2001 From: Tobias Brox Date: Tue, 10 Sep 2019 13:22:37 +0000 Subject: ref https://github.com/tobixen/calendar-cli/issues/56 fix nice error messages if config is missing --- calendar-cli.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/calendar-cli.py b/calendar-cli.py index aa15483..65ade03 100755 --- a/calendar-cli.py +++ b/calendar-cli.py @@ -216,7 +216,7 @@ def interactive_config(args, config, remaining_argv): modified = False print("Welcome to the interactive calendar configuration mode") - print("Warning - untested code ahead, raise issues at t-calendar-cli@tobixen.no") + print("Warning - untested code ahead, raise issues at t-calendar-cli@tobixen.no or the github repo") if not config or not hasattr(config, 'keys'): config = {} print("No valid existing configuration found") @@ -898,8 +898,16 @@ def main(): args = parser.parse_args(remaining_argv) if not args.nocaldav: + if not args.calendar_url: + sys.stderr.write(""" +missing mandatory argument calendar_url +Have you set up a config file? Read the doc or ... +... use the --interactive-config option to create a config file +""") + sys.exit(1) caldav_conn = caldav_connect(args) else: + caldav_conn = None if args.ssl_verify_cert == 'no': -- cgit v1.2.3