Reputation: 5966
I have a project that works with modules, which are called with CLI commands (ie. myapp foo
calls the foo
module).
Modules can be builtin or user defined. I defined some builtin modules with Cobra commands and it works well. Now I want to handle user defined modules, so myapp bar
will look for a bar
file in some folder, since the bar
command is not defined.
How to do this without having a unknown command "bar"
error, or to add commands at runtime?
Upvotes: 1
Views: 96