aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/docker/get_output_dir.py
blob: 9c21a72acd506794c27771563c2388f2251a5a28 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python

from argparse import ArgumentParser
import sys

from cgitize.config import Config


def parse_args(argv=None):
    if argv is None:
        argv = sys.argv[1:]
    parser = ArgumentParser()
    parser.add_argument('config', metavar='PATH',
                        help='config file path')
    return parser.parse_args(argv)


def main(argv=None):
    args = parse_args(argv)
    cfg = Config.read(args.config)
    print(cfg.main.output_dir)


if __name__ == '__main__':
    main()