mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Modification on top of skvidal's common options patch to keep options to command line tools sorted.
This commit is contained in:
23
bin/ansible
23
bin/ansible
@@ -47,12 +47,23 @@ class Cli(object):
|
||||
def parse(self):
|
||||
''' create an options parser for bin/ansible '''
|
||||
|
||||
parser = utils.base_parser(constants=C, runas_opts=True, async_opts=True,
|
||||
output_opts=True, usage='ansible <host-pattern> [options]')
|
||||
parser.add_option('-a', '--args', dest='module_args',
|
||||
help="module arguments", default=C.DEFAULT_MODULE_ARGS)
|
||||
parser.add_option('-m', '--module-name', dest='module_name',
|
||||
help="module name to execute", default=C.DEFAULT_MODULE_NAME)
|
||||
|
||||
options = {
|
||||
'-a' : dict(long='--args', dest='module_args',
|
||||
help="module arguments", default=C.DEFAULT_MODULE_ARGS),
|
||||
'-m' : dict(long='--module-name', dest='module_name',
|
||||
help="module name to execute", default=C.DEFAULT_MODULE_NAME)
|
||||
}
|
||||
|
||||
parser = utils.make_parser(
|
||||
options,
|
||||
usage='ansible <host-pattern> [options]',
|
||||
runas_opts=True,
|
||||
async_opts=True,
|
||||
output_opts=True,
|
||||
|
||||
)
|
||||
|
||||
|
||||
options, args = parser.parse_args()
|
||||
self.callbacks.options = options
|
||||
|
||||
Reference in New Issue
Block a user