added help text and usage examples
This commit is contained in:
@ -62,14 +62,25 @@ def check_equal(val, ref):
|
||||
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||
example_text = """usage examples:
|
||||
Dry run (nothing is changed or overwritten)
|
||||
%(prog)s alvra p12345
|
||||
|
||||
parser.add_argument("instrument", choices=INSTRUMENTS)
|
||||
parser.add_argument("pgroup", type=check_pgroup)
|
||||
Create new files called scan_mod.json
|
||||
%(prog)s alvra p12345 --no-dryrun
|
||||
|
||||
parser.add_argument("--no-dryrun", dest="dryrun", action="store_false")
|
||||
parser.add_argument("--inplace", action="store_true")
|
||||
parser.add_argument("--overwrite", action="store_true")
|
||||
Overwrite scan.json
|
||||
%(prog)s alvra p12345 --no-dryrun --overwrite --inplace
|
||||
"""
|
||||
|
||||
parser = argparse.ArgumentParser(epilog=example_text, formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
|
||||
parser.add_argument("instrument", choices=INSTRUMENTS, help="Which instrument has the data been measured at?")
|
||||
parser.add_argument("pgroup", type=check_pgroup, help="Which pgroup is the data in?")
|
||||
|
||||
parser.add_argument("--no-dryrun", dest="dryrun", action="store_false", help="Disable dry run. If dryrun is enabled (default) no files are written.")
|
||||
parser.add_argument("--inplace", action="store_true", help="Update scan.json in place. If inplace is disabled (default) a new file scan_mod.json is created.")
|
||||
parser.add_argument("--overwrite", action="store_true", help="Overwrite existing files. If overwrite is disabled (default) existing files will be skipped.")
|
||||
|
||||
clargs = parser.parse_args()
|
||||
#print(clargs)
|
||||
|
Reference in New Issue
Block a user