-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrunner.py
More file actions
40 lines (38 loc) · 1.24 KB
/
runner.py
File metadata and controls
40 lines (38 loc) · 1.24 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import pygroff as pg
from pygroff import compiler
import argparse as ap
arg = ap.ArgumentParser()
arg.add_argument(
"-l",
type=str,
help="Default language string if not python",
required=False,
default="python -c",
)
arg.add_argument("-f", type=str, help="Input file path", required=True)
arg.add_argument("-o", type=str, help="Output file path", required=True)
arg.add_argument(
"-toc", type=str, help="Add table of contents", required=False, default=True
)
arg.add_argument("-c", help="Add cover page", action="store_true")
arg.add_argument(
"-w", type=bool, help="Convert to word?", required=False, default=False
)
arg.add_argument("-n", type=str, help="Name for cover page", required=False)
arg.add_argument("-t", type=str, help="Title for cover page", required=False)
arg.add_argument(
"-e",
type=bool,
help="Execute python code and return output",
required=False,
default=True,
)
arg.add_argument("-i", type=bool, help="Are there images", required=False, default=True)
arg.add_argument(
"-df", type=str, help="Different date format", required=False, default="%B %d ,%Y"
)
arg.add_argument(
"-d", type=str, help="Delete intermediates", required=False, default=True
)
ag = arg.parse_args()
compiler.main(ag)