From f840c0d1673761f15ab0118625766573ee5bf73d Mon Sep 17 00:00:00 2001 From: Brad Olson Date: Mon, 9 Apr 2012 23:12:05 +0000 Subject: [PATCH] Wired in Michael's usage string optparse style. --- bin/ansible | 2 +- lib/ansible/utils.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/ansible b/bin/ansible index 4d0a3b9c4b6..21a09588bdc 100755 --- a/bin/ansible +++ b/bin/ansible @@ -57,7 +57,7 @@ class Cli(object): parser = utils.make_parser( options, - usage='ansible [options]', + usage='%prog [options]', runas_opts=True, async_opts=True, output_opts=True, diff --git a/lib/ansible/utils.py b/lib/ansible/utils.py index 5eb5d07e5d0..ce2a682e294 100755 --- a/lib/ansible/utils.py +++ b/lib/ansible/utils.py @@ -284,7 +284,9 @@ def make_parser(add_options, constants=C, usage="", output_opts=False, runas_opt ) options.update(add_options) + #NOTE: optparse deprecated in Python >= 2.7. parser = optparse.OptionParser() + parser.set_usage(usage) names = sorted(options.keys()) for n in names: data = options[n].copy()