diff --git a/bin/swh-web-ui b/bin/swh-web-ui index 52af25d12..ad3d79f85 100755 --- a/bin/swh-web-ui +++ b/bin/swh-web-ui @@ -1,41 +1,42 @@ #!/usr/bin/env python3 # Copyright (C) 2015 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information import argparse import logging import os from swh.web.ui import controller, main # Default configuration file DEFAULT_CONF_FILE = '~/.config/swh/web-ui.ini' # Default configuration in swh.web.ui.main + def parse_args(): """Parse the configuration for the cli. """ cli = argparse.ArgumentParser(description="SWH's web ui.") cli.add_argument('--verbose', '-v', action='store_true', help='Verbosity level in log file.') cli.add_argument('--config', '-c', help='configuration file path') args = cli.parse_args() return args if __name__ == '__main__': args = parse_args() conf = main.read_config(args.config or DEFAULT_CONF_FILE) logging.basicConfig(filename=os.path.join(conf['log_dir'], 'web-ui.log'), level=logging.DEBUG if args.verbose else logging.INFO) controller.run(conf)