Adding a doc mode to the printcfg
Needs some more work, but can be used to print out a lengthy commmand
line help. Time to go for a run, will finish later:-)
@@ -273,11 +273,20 @@ class Chip:
newkeys = keys.copy()
newkeys.append(k)
if 'value' in cfg[k]:
- valstr = ' '.join(cfg[k]['value'])
keystr = ' '.join(newkeys)
- if(mode=="tcl"):
+ if(mode=='doc'):
+ valstr = '\n'.join(cfg[k]['help'])
+ outlst = [keystr,
+ '\n',
+ valstr,
+ '\n']
+ outstr = ' '.join(outlst)
+ elif (mode=='tcl'):
+ valstr = ' '.join(cfg[k]['value'])
outlst = [prefix,keystr,'[list ', valstr,']']
+ outstr = ' '.join(outlst)
else:
+ valstr = ' '.join(cfg[k]['value'])
outlst = [prefix,keystr, valstr]
outstr = ' '.join(outlst)
if f is None:
