Changing to only print out short hekp with -h command
No option prints switches and errror message
-h prints short help
How to print a longer help, do later..
@@ -63,7 +63,7 @@ def cmdline():
# Required positional source file argument
parser.add_argument('source',
nargs='+',
- help='\n'.join(def_cfg['source']['help']))
+ help=def_cfg['source']['short_help'])
#Recursive argument adder
add_arg(def_cfg, parser)
@@ -81,6 +81,7 @@ def cmdline():
#destination is the nested cfg dictionary
cfg= {}
+ #TODO: implement with switch
for key,all_vals in cmdargs.items():
@@ -124,6 +125,8 @@ def cmdline():
def add_arg(cfg, parser, keys=None):
''' Recursively add command line arguments from cfg dictionary
'''
+ #TODO: fix properly with command line check
+ longhelp = False
if keys is None:
keys = []
for k,v in sorted(cfg.items()):
@@ -135,6 +138,7 @@ def add_arg(cfg, parser, keys=None):
elif k in ('flow', 'goal', 'real'):
for k2 in cfg[k]['import'].keys():
helpstr = cfg[k]['import'][k2]['short_help']
+ if longhelp:
helpstr = (helpstr +
'\n\n' +
'\n'.join(cfg[k]['import'][k2]['help']) +
@@ -152,6 +156,7 @@ def add_arg(cfg, parser, keys=None):
if 'defvalue' in cfg[k].keys():
keystr = '_'.join(newkeys)
helpstr = cfg[k]['short_help']
+ if longhelp:
helpstr = (helpstr +
'\n\n' +
'\n'.join(cfg[k]['help']) +
@@ -222,8 +227,8 @@ def main():
#Lock chip configuration
chip.lock()
- all_stages = chip.get('design_steps')
- for stage in all_stages:
+ all_steps = chip.get('design_steps')
+ for stage in all_steps:
# Run each stage on the remote compute cluster if requested.
if len(chip.cfg['remote']['value']) > 0:
remote_run(chip, stage)
