Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Built-in support for multiple command loaders #128

Open
tjprescott opened this issue Nov 13, 2018 · 7 comments
Open

Built-in support for multiple command loaders #128

tjprescott opened this issue Nov 13, 2018 · 7 comments

Comments

@tjprescott
Copy link
Member

Knack supports only a single command loader which makes it tricky to use in scenarios like Azure CLI which has several modules. Knack should work in a consistent way for single or multiple command modules.

@JonnyWaffles
Copy link

Hi all, is this project still being maintained? The above feature makes a lot of sense. Is knack still intended to be the framework Azure CLI development?

@tjprescott tjprescott removed their assignment Oct 10, 2019
@tjprescott
Copy link
Member Author

@myronfanqiu for comment.

@mmyyrroonn
Copy link

@jiasli for comment.

@jiasli
Copy link
Member

jiasli commented Oct 15, 2019

Hi @tjprescott, is this causing any problem right now? Could you provide more info?

@tjprescott
Copy link
Member Author

tjprescott commented Oct 15, 2019

Knack itself only accepts a single command loader. Azure CLI works around this by creating a command loader that loads a bunch of other command loaders (and extension loaders). The ability to load one or more command loaders would make sense to be in Knack itself. This would allow other CLIs that use Knack to take advantage and would allow the CLI core to be simplified by pushing that logic into Knack.

@mjalas
Copy link

mjalas commented Mar 18, 2020

Hi all,

This issue seems to have existed for some time now already and I'm wondering about what the current timeline is for multiple command loaders to be supported in Knack?

The approach I've used so far is to inject the command loader through a default function that every plugin implements, which is called when each plugin is loaded in the main function of the CLI. This approach has worked well enough so far and the core of the plugin loading function is about 15 lines of code, so in that sense not much to maintain either. However, it would of course be nice if Knack itself would provide a "cleaner" way of doing this with Python code.

@masonhuemmer
Copy link

What is the status for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants