diff options
Diffstat (limited to '')
-rw-r--r-- | quarg/main.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/quarg/main.py b/quarg/main.py index cbd5177..3927723 100644 --- a/quarg/main.py +++ b/quarg/main.py @@ -13,8 +13,6 @@ from quarg.database.tables import Backlog, Buffer, Network, QuasselUser, Sender from quarg.quassel.formatter import format_from from quarg.utils import errx -# TODO Make --after/--before and --around mutually exclusive - # pylint: disable=line-too-long cli = argparse.ArgumentParser() cli.add_argument('query', nargs='*', help='match messages containing this query') @@ -51,6 +49,11 @@ def get_config(): return config +def check_args(args): + if args.around is not None: + if args.before is not None or args.after is not None: + errx('--around cannot be used with --after or --before') + def collect_predicates(args): funs = { 'query': filters.msg_like if args.expr else filters.msg_contains, @@ -110,6 +113,7 @@ def main(): errx('No database URL set in config file.') args = cli.parse_args() + check_args(args) engine = create_engine(config.get('Database', 'url'), echo=args.debug) session = Session(bind=engine) |