Skip to content

How DynaCLI Works

DynaCLI library is a simple preprocessor for the argparse standard Python library. It scans the sys.argv array to process command line arguments one by one, uses the importlib.import_module function to bring in feature packages/modules and command modules, uses the inspect.signature to understand command function arguments and the re.match function to extract help string per argument. If it encounters a StopIteration or ModuleNotFound exception, it will use the pkgutil.iter_modules function to build help for available features and commands.

The overall structure of the DynaCLI library is illustrated below:

DynaCLI Structure