From 3e7bb377cc5ea6b76f0ad87a02e4cb12e22019fe Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Fri, 2 May 2014 13:15:52 +0200 Subject: [PATCH] Add error message when general section is missing Fix #43 Fix #45 --- vdirsyncer/cli.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vdirsyncer/cli.py b/vdirsyncer/cli.py index 978eff8..f0dea12 100644 --- a/vdirsyncer/cli.py +++ b/vdirsyncer/cli.py @@ -33,6 +33,7 @@ def load_config(fname, pair_options=('collections', 'conflict_resolution')): get_options = lambda s: dict(parse_options(c.items(s), section=s)) + general = None pairs = {} storages = {} @@ -55,6 +56,12 @@ def load_config(fname, pair_options=('collections', 'conflict_resolution')): cli_logger.error( 'Unknown section in {}: {}'.format(fname, section)) + if not general: + cli_logger.error('Unable to find general section. You should copy the ' + 'example config from the repository and edit it.') + cli_logger.error('https://github.com/untitaker/vdirsyncer') + sys.exit(1) + return general, pairs, storages