Consider the following piece of code:
parser = optparse.Option Parser(usage="u sage: %prog <input filename>
<output filename[options]", add_help_option =False)
parser.add_opti on("-d", type="string", action="store", dest="DELIM",
default="|", help="single character delimiter in quotes (default: |)")
(options, args) = parser.parse_ar gs()
Is there any way I can add help for the arguments (<input filenameand
<output filename>) in the same table that optparse generates above the
options section. Ideally, I would like the output as:
=============== =============== =============== =========
usage: DelimTOFixedWid th.py <input filename<output filename[options]
required:
input filename name of the delimited input file
output filename name of fixed-width output file
options:
-d DELIM single character delimiter in quotes (default: |)
=============== =============== =============== =========
Is that possible using optparse?
Thanks.
parser = optparse.Option Parser(usage="u sage: %prog <input filename>
<output filename[options]", add_help_option =False)
parser.add_opti on("-d", type="string", action="store", dest="DELIM",
default="|", help="single character delimiter in quotes (default: |)")
(options, args) = parser.parse_ar gs()
Is there any way I can add help for the arguments (<input filenameand
<output filename>) in the same table that optparse generates above the
options section. Ideally, I would like the output as:
=============== =============== =============== =========
usage: DelimTOFixedWid th.py <input filename<output filename[options]
required:
input filename name of the delimited input file
output filename name of fixed-width output file
options:
-d DELIM single character delimiter in quotes (default: |)
=============== =============== =============== =========
Is that possible using optparse?
Thanks.
Comment