diff --git a/financeager/cli.py b/financeager/cli.py
index d972c0a..b0ac2d0 100644
--- a/financeager/cli.py
+++ b/financeager/cli.py
@@ -5,6 +5,8 @@ import argparse
import os
import sys
+import argcomplete
+
from financeager import offline, communication, __version__,\
init_logger, make_log_stream_handler_verbose, setup_log_file_handler
import financeager
@@ -26,13 +28,14 @@ def main():
directory are created. A FileHandler is added to the package logger.
All command line arguments and options are parsed and passed to 'run()'.
"""
+ args = _parse_command()
os.makedirs(financeager.DATA_DIR, exist_ok=True)
# Adding the FileHandler here avoids cluttering the log during tests
setup_log_file_handler()
# Most runs return None which evaluates to return code 0
- sys.exit(run(**_parse_command()))
+ sys.exit(run(**args))
def run(command=None, config=None, verbose=False, **cl_kwargs):
@@ -251,6 +254,7 @@ least a frequency, start date and end date are optional. Default:
subparser.add_argument(
"-p", "--period", help="name of period to modify or query")
+ argcomplete.autocomplete(parser)
return vars(parser.parse_args(args=args))
E.g. using argcomplete