forked from Componolit/Cappulada
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcappulada
executable file
·27 lines (22 loc) · 1.3 KB
/
cappulada
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
#!/usr/bin/env python
import os
import sys
import argparse
from capdpa import Generator
if __name__ == "__main__":
parser = argparse.ArgumentParser(epilog="After headers `--` can be passed. "
"Any argument after this token will be passed directly to clang. "
"Example: `cappulada header1.h header2.h -- -I include_dir`")
parser.add_argument('-o', '--outdir', help="target directory", default=os.path.abspath(os.curdir))
parser.add_argument('-p', '--project', help="project name", default="Capdpa")
#parser.add_argument('-s', '--spec_include', help="specification include")
#parser.add_argument('-w', '--with_include', help="with include")
parser.add_argument('headers', help="header files", nargs='+')
args = parser.parse_args(sys.argv[1:sys.argv.index('--')] if '--' in sys.argv else sys.argv[1:])
generator = Generator(project = args.project,
outdir = args.outdir,
headers = args.headers,
clang_args = sys.argv[sys.argv.index('--') + 1:] if '--' in sys.argv else [],
with_include = args.with_include,
spec_include = args.spec_include)
generator.run()