forked from tweecode/twee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoward
executable file
·45 lines (30 loc) · 815 Bytes
/
toward
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
41
42
43
44
45
#!/usr/bin/env python
import sys, os, getopt, glob
scriptPath = os.path.realpath(os.path.dirname(sys.argv[0]))
sys.path.append(scriptPath + os.sep + 'lib')
from project import Project
def usage():
print 'usage: toward source1 [source2..]'
def main (argv):
proj = Project()
proj.destination = 'proof.rtf'
# arguments
try:
opts, args = getopt.getopt(argv, 'o', ['output='])
except getopt.GetoptError:
usage()
sys.exit(2)
for opt, arg in opts:
if (opt in ('-o', '--output')):
proj.destination = arg
# add source files to project
for arg in args:
for file in glob.glob(arg):
proj.sources.append(file)
if len(proj.sources) == 0:
print 'toward: no source files specified\n'
sys.exit(2)
# build the proof
proj.proof()
if __name__ == '__main__':
main(sys.argv[1:])