You are on page 1of 1

File: /home/henry/Desktop/docopt/doc.

py

Page 1 of 1

"""
usage: doc.py [-h] [-x X] [-y Y] [-t T] [-c C] [-s S]
[-j J] [--fold] [--complex COMPLEX]
[--djk DJK] [--scale SCALE] [--shift SHIFT]
[--title TITLE] [--legend] [--grid] [--write]
<data>
create effective mass plot of correlation function data
positional arguments:
<data>

list of data files [ .dat .h5 ] format

optional arguments:
-h, --help
show this help message and exit
-x X
x_range: xi xf
-y Y
y_range: yi yf
-t T
type of effective mass plot: exp, cosh, cosh_constant [coshC] [default: exp]
-c C
list of colors for effective mass plot
-s S
list of shapes for effective mass plot
-j J
list of juge parameters for effective mass plot [default: 1]
--fold
fold correlator with phase=1?
--complex COMPLEX
[ re im complex ] correlator?
--djk DJK
list of djk used for creating JK correlators [default: 1]
--scale SCALE
list of multiplicative y_scale factors for eff_mass data
--shift SHIFT
list of additive x_shifts for eff_mass data [default: 0.0]
--title TITLE
title of plot
--legend
show legend?
--grid
show grid?
--write
write effective mass data to file?
"""
from docopt import docopt
inputArgs=docopt(__doc__)

class argsl():
pass
args = argsl()
for x in range(len(inputArgs)):
temp = str(inputArgs.keys()[x])
if not isinstance(inputArgs[inputArgs.keys()[x]], bool):
value = str(inputArgs[temp]).split(',')
else:
value = inputArgs[temp]
setattr(args,temp.replace("-", "").replace(">", "").replace("<", ""),value)
print args.__dict__

You might also like