1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Added usage info to bin/ansible-playbook, now shows options on bare command line. NOTE: bin/ansible outputs usage to stdout, bin/ansible-playbook to stderr. Should they be consistent?

This commit is contained in:
Brad Olson 2012-04-10 15:17:25 +00:00
parent 74b26da9ac
commit 5a4d4bc051

View file

@ -32,7 +32,7 @@ def main(args):
''' run ansible-playbook operations ''' ''' run ansible-playbook operations '''
# create parser for CLI options # create parser for CLI options
usage = "%prog playbook.yml [options]" usage = "%prog <playbook-file1 [playbook-file2...]> [options]"
options = { options = {
'-e' : dict(long='--extra-vars', dest='extra_vars', '-e' : dict(long='--extra-vars', dest='extra_vars',
help='pass in extra key=value variables from outside the playbook'), help='pass in extra key=value variables from outside the playbook'),
@ -43,7 +43,9 @@ def main(args):
options, args = parser.parse_args(args) options, args = parser.parse_args(args)
if len(args) == 0: if len(args) == 0:
print >> sys.stderr, "playbook path is a required argument" parser.print_help(file=sys.stderr)
#QUESTION for M.D. This would match bin/ansible's behavior. Do we want them consistent?
#parser.print_help()
return 1 return 1
sshpass = None sshpass = None