Skip to content

Allow cli.all_commands() to be called more than once.

cli.Application.factory() calls arg.build_parser() which calls
cli.all_commands() to get a dictionary of registered commands
(built-in and from plugins). Prior to this commit a second call to
cli.all_commands() would return an incomplete dictionary of commands
(plugins missing). This commit fixes that by memoizing the result of
the first call and reusing it on subsequent calls.

tests/scap/plugins/test_plugins.py:
New test case to verify that cli.Application.factory (which uses
cli.all_commands()) can be used more than once.

Edited by Ahmon Dancy

Merge request reports