10: #line 30 "interscript_options.ipk"
11:
12: shortoptdict = { 'v':'verbose (verbosity=6)' }
13:
14: longoptdict = {
15: 'echo_input=':{0:"Don't echo input (default)",1:'Echo input'},
16: 'verbosity=': {
17: 0:'no messages',
18: 1:'fatal messages',
19: 2:'warnings',
20: 3:'brief progress',
21: 4:'progress and information',
22: 5:'full progress and information',
23: 6:'user source debugging',
24: 7:'interscript debugging',
25: 8:'full interscript debugging',
26: 9:'eveything'
27: },
28: 'weaver=': {
29: 'html': 'flat html',
30: 'latex': 'latex2e',
31: 'text':'plain text',
32: 'web':'html tree',
33: },
34: 'tangler-prefix=':'absolute native os prefix prepended to tangled code filenames',
35: 'weaver-prefix=':'absolute native os prefix prepended to woven documentation filenames',
36: 'tangler-directory=':'interscript filename prefix prepended to tangled code filenames',
37: 'weaver-directory=':'interscript filename prefix prepended to woven documentation filenames',
38: 'source-prefix=':'absolute native prefix prepended to input filename',
39: 'python=':'execute python script',
40: 'update=':{
41: 0:'Allow buffered file write (default)',
42: 1:'Inhibit buffered file write'},
43: 'download=':{
44: 0:'only download by ftp or http when necessary',
45: 1:'force download by ftp or http'},
46: 'refresh_interval=':
47: 'download when local file is older than this number of days (default 28)',
48: 'tabwidth=':'column width for tab expansion (default 8)',
49: 'passes=':'passs on each file (default 1)',
50: 'logfile=':'<filename> for messages (append to old file)',
51: 'new-logfile=':'<filename> for messages (cleared first)',
52: 'nocache':'disable persistent cache usage',
53: 'copyright': '(prints) Maxtal P/L Australia',
54: 'licence': '(prints) Free for any use',
55: 'author': '(prints) mailto:skaller@maxtal.com.au <John Skaller>',
56: 'homepage': '(prints) http://www.triode.net.au/~skaller/interscript',
57: 'executable': 'print python executable name',
58: 'python-version': 'print python version string',
59: 'title=':'set document title',
60: 'html-eol=': {
61: 'CRLF': 'Kludge Unix host (only) to end html lines (only) with CR/LF'
62: },
63: 'help':'this help',
64: 'usage':'this help' }
65:
66:
67: def print_help():
68: print 'Usage: python iscr.py [options] <filename>'
69: print 'Short options:'
70: keys = shortoptdict.keys()
71: keys.sort()
72: for k in keys: print_help1(k)
73: print 'Long options:'
74: keys = longoptdict.keys()
75: keys.sort()
76: for k in keys: print_help1(k)
77:
78: def print_help1(k):
79: if longoptdict.has_key(k):
80: usek = '--'+ k
81: values = longoptdict[k]
82: elif longoptdict.has_key(k+'='):
83: usek = '--'+ k + '='
84: values = longoptdict[k+'=']
85: elif shortoptdict.has_key(k):
86: usek = '-' + k
87: values = shortoptdict[k]
88: elif shortoptdict.has_key(k+'='):
89: usek = '-' + k + '='
90: values = shortoptdict[k+'=']
91: else:
92: usek = k
93: values = 'Unknown option'
94:
95: print ' '+usek,
96: if values is None:
97: print
98: elif type(values) is type({}):
99: print
100: for value in values.keys():
101: print ' '+str(value)+':',values[value]
102: else:
103: print values
104: