7: #line 23 "interscript_options.ipk" 8: #option help dictionary 9: shortoptdict = { 'v':'verbose (verbosity=6)' } 10: 11: longoptdict = { 12: 'echo_input=':{0:"Don't echo input (default)",1:'Echo input'}, 13: 'verbosity=': { 14: 0:'no messages', # none _at all_, not even serious errors 15: 1:'fatal messages', # _only_ serious errors 16: 2:'warnings', # all errors 17: 3:'brief progress', # open and close weavers, tanglers, files 18: 4:'progress and information', # headings, 'watch it run' 19: 5:'full progress and information', # full user information 20: 6:'user source debugging', # full debugging of _user_ script 21: 7:'interscript debugging', # basic control flow debugging 22: 8:'full interscript debugging', # enough to debug interscript itself 23: 9:'eveything' # for unintelligible output :-) 24: }, 25: 'weaver=': { 26: 'html': 'flat html', 27: 'tex': 'plain tex (not implemented)', 28: 'latex': 'latex2e', 29: 'text':'plain text', 30: 'ps': 'postscript (not implemented)', 31: 'eps': 'encapsulated postscript (not implemented)', 32: 'rtf': 'Rich Text (not implemented)', 33: 'word': 'microsoft word (not implemented)', 34: 'none': 'disable built-in weaving' 35: }, 36: 'tangler-prefix=':'absolute native os prefix prepended to tangled code filenames', 37: 'weaver-prefix=':'absolute native os prefix prepended to woven documentation filenames', 38: 'tangler-directory=':'interscript filename prefix prepended to tangled code filenames', 39: 'weaver-directory=':'interscript filename prefix prepended to woven documentation filenames', 40: 'source-prefix=':'absolute native prefix prepended to input filename', 41: 'python=':'execute python script', 42: 'update=':{ 43: 0:'Allow buffered file write (default)', 44: 1:'Inhibit buffered file write'}, 45: 'download=':{ 46: 0:'only download by ftp or http when necessary', 47: 1:'force download by ftp or http'}, 48: 'refresh_interval=': 49: 'download when local file is older than this number of days (default 28)', 50: 'tabwidth=':'column width for tab expansion (default 8)', 51: 'passes=':'passs on each file (default 1)', 52: 'logfile=':'<filename> for messages', 53: 'help':'this help', 54: 'usage':'this help' } 55: 56: 57: def print_help(): 58: print 'Usage: python iscr.py [options] <filename>' 59: print ' options:' 60: for k in shortoptdict.keys(): print_help1(k) 61: for k in longoptdict.keys(): print_help1(k) 62: 63: def print_help1(k): 64: if longoptdict.has_key(k): 65: k = '--'+ k + '=' 66: values = longoptdict[k] 67: elif shortoptdict.has_key(k+'='): 68: k = '-' + k + '=' 69: values = shortoptdict[k] 70: else: 71: values = 'Unknown option' 72: 73: print ' '+k, 74: if values is None: 75: print 76: elif type(values) is type({}): 77: print 78: for value in values.keys(): 79: print ' '+str(value)+':',values[value] 80: else: 81: print values 82: