Exclude functions that start with underscore from commands
This commit is contained in:
parent
4878b85d2f
commit
4c047bdb2e
@ -38,7 +38,7 @@ def magicli(exclude=['main'], glbls=None, argv=None):
|
|||||||
print(glbls['__version__']) if '__version__' in glbls else print('Unknown version.')
|
print(glbls['__version__']) if '__version__' in glbls else print('Unknown version.')
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
function_to_call, *commands = [f for f in filter_functions(glbls) if f.__name__ not in exclude]
|
function_to_call, *commands = [f for f in filter_functions(glbls) if f.__name__ not in exclude and not f.__name__.startswith('_')]
|
||||||
command_names = [f.__name__ for f in commands]
|
command_names = [f.__name__ for f in commands]
|
||||||
|
|
||||||
# Call command if specified
|
# Call command if specified
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user