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
Expose a model of the command structure #104
Comments
Ping? |
Hi 👋 Sorry for the delay. I'm playing with different options to expose the CLI's structure (commands, options, arguments) without trying it to the internal data structures. I'll hopefull have a PoC soon in a separate branch if you are willing to test it before merging it. The idea would be to have a new package, |
This would be great.
In the interim, I've ended up having to duplicate the command structure I'm using for this CLI framework, then hard-code what the responses should be. I think that by exposing the structure of the model, it will become dramatically simpler (and more DRY) to respond to Thank you! |
OK. I have some time to play with this today. Any idea how to pull this branch with |
I have tested this, and it works marvelously. Thank you. Getting a new tag with this functionality would be appreciated. |
`app.Model()` Fixes jawher#104
It's easy to build out a command structure to get a CLI app up and going fairly quickly (thank you!).
That said, once I've modeled the command structure in code, I'd like to be able to access a representation of what's been set up. Something that exposes the command structure (possibly as a set of nested structs?).
My end goal is to be able to take this exposed model and do things like generate Bash/Zsh/Fish/Powershell auto-completion scripts. By opening this up, it would make it easier for other packages to integrate features of this type.
I haven't yet dug into the code enough to fully understand the internals, but it looks like it would start with exposing the model for
Cmd.commands[]
.mow.cli/commands.go
Lines 127 to 141 in fbc50e9
The text was updated successfully, but these errors were encountered: