Wired in Michael's usage string optparse style.
This commit is contained in:
parent
6749903e57
commit
f840c0d167
2 changed files with 3 additions and 1 deletions
|
@ -57,7 +57,7 @@ class Cli(object):
|
||||||
|
|
||||||
parser = utils.make_parser(
|
parser = utils.make_parser(
|
||||||
options,
|
options,
|
||||||
usage='ansible <host-pattern> [options]',
|
usage='%prog <host-pattern> [options]',
|
||||||
runas_opts=True,
|
runas_opts=True,
|
||||||
async_opts=True,
|
async_opts=True,
|
||||||
output_opts=True,
|
output_opts=True,
|
||||||
|
|
|
@ -284,7 +284,9 @@ def make_parser(add_options, constants=C, usage="", output_opts=False, runas_opt
|
||||||
)
|
)
|
||||||
options.update(add_options)
|
options.update(add_options)
|
||||||
|
|
||||||
|
#NOTE: optparse deprecated in Python >= 2.7.
|
||||||
parser = optparse.OptionParser()
|
parser = optparse.OptionParser()
|
||||||
|
parser.set_usage(usage)
|
||||||
names = sorted(options.keys())
|
names = sorted(options.keys())
|
||||||
for n in names:
|
for n in names:
|
||||||
data = options[n].copy()
|
data = options[n].copy()
|
||||||
|
|
Loading…
Reference in a new issue