You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having found myself frustrated with argparse, I started looking into Knack for argument parsing.
One of the choices that I'm wondering about in Knack is the choice to specify the command groups with strings, which when used are passed to import_module & a python version independent inspect to get the implementation of the command.
This makes it difficult to use static analysis to verify code using this module, since it's roughly akin to eval.
Additionally, it makes it difficult to programmatically generate a CLI from classes, as it requires going from object instance back to strings for the module and function paths.
Is there any interest in supporting functions rather than strings?
Something akin to:
with CommandGroup(self, "hello") as g:
g.command("world", hello_world_handler)
The text was updated successfully, but these errors were encountered:
Having found myself frustrated with argparse, I started looking into Knack for argument parsing.
One of the choices that I'm wondering about in Knack is the choice to specify the command groups with strings, which when used are passed to
import_module
& a python version independentinspect
to get the implementation of the command.This makes it difficult to use static analysis to verify code using this module, since it's roughly akin to eval.
Additionally, it makes it difficult to programmatically generate a CLI from classes, as it requires going from object instance back to strings for the module and function paths.
Is there any interest in supporting functions rather than strings?
Something akin to:
The text was updated successfully, but these errors were encountered: