1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/units/cli
Toshio Kuratomi 7e92ff823e Split up the base_parser function
The goal of breaking apart the base_parser() function is to get rid of
a bunch of conditionals and parameters in the code and, instead, make
code look like simple composition.

When splitting, a choice had to be made as to whether this would operate
by side effect (modifying a passed in parser) or side effect-free
(returning a new parser everytime).

Making a version that's side-effect-free appears to be fighting with the
optparse API (it wants to work by creating a parser object, configuring
the object, and then parsing the arguments with it) so instead, make it
clear that our helper functions are modifying the passed in parser by
(1) not returning the parser and (2) changing the function names to be
more clear that it is operating by side-effect.

Also move all of the generic optparse code, along with the argument
context classes, into a new subdirectory.
2019-01-03 18:12:23 -08:00
..
test_data/role_skeleton Link to the Galaxy platforms list from the meta file template (#34046) 2018-09-17 13:39:54 -05:00
__init__.py galaxy info displayed 'galaxy_info' section wrong 2016-05-31 13:28:15 -04:00
test_adhoc.py Save the command line arguments into a global context 2019-01-03 18:12:23 -08:00
test_cli.py Split up the base_parser function 2019-01-03 18:12:23 -08:00
test_console.py Move unit test compat code out of lib/ansible/. (#46996) 2018-10-12 20:01:14 -07:00
test_galaxy.py Split up the base_parser function 2019-01-03 18:12:23 -08:00
test_playbook.py Save the command line arguments into a global context 2019-01-03 18:12:23 -08:00
test_vault.py Move unit test compat code out of lib/ansible/. (#46996) 2018-10-12 20:01:14 -07:00