diff --git a/bin/ansible b/bin/ansible index 4d0a3b9c4b..21a09588bd 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 5eb5d07e5d..ce2a682e29 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()