Coverage for tutkia/cli.py: 0.00%
18 statements
« prev ^ index » next coverage.py v7.4.1, created at 2024-02-05 19:32:08 +00:00
« prev ^ index » next coverage.py v7.4.1, created at 2024-02-05 19:32:08 +00:00
1"""Explore (Finnish: tutkia) ticket system trees. - command line interface."""
3import argparse
4import sys
5from typing import no_type_check
7import tutkia.api as api
10@no_type_check
11def parser():
12 """Implementation of command line API returning parser."""
13 impl = argparse.ArgumentParser(description='Explore.')
14 impl.add_argument(
15 '-v',
16 '--verbose',
17 dest='verbose',
18 action='store_true',
19 help='Be more verbose, maybe',
20 )
21 impl.add_argument(
22 '-d',
23 '--debug',
24 dest='debug',
25 action='store_true',
26 help='Support debugging, maybe',
27 )
28 impl.add_argument(
29 '-q',
30 '--query',
31 dest='query',
32 type=str,
33 help='A valid JQL query',
34 )
35 return impl
38@no_type_check
39def app(argv=None):
40 """Drive the exploration."""
41 argv = sys.argv[1:] if argv is None else argv
42 options = parser().parse_args(argv)
43 return api.process(options)
46if __name__ == '__main__':
47 sys.exit(app(sys.argv[1:]))