-
Notifications
You must be signed in to change notification settings - Fork 125
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
Multiple Commands #71
Comments
This is definitely something for the roadmap, it's something I'm looking for as well. I could just remove the first argument and manually check it, but then I can't use the nice |
👍 Would be great to have a single |
I maintain a wrapper for symfony/console that adds support for CLImate as the output handler, might be of use to you: https://github.com/duncan3dc/console |
Starred! Thanks. |
Hi, I wanted to wait before I post in this thread, but I've got interrogations... I'm working on this feature and there are things I'm facing that need to be resolved, and I don't want to take decisions on my own. There is currently no concept of Input in CLImate: the arguments are retrieved in the parser ( The problem is: refactoring how the input is handled (introducing an Input concept) may introduce some BC breaks. I've got multiple commands already working (for now as a separate package), but it's not elegantly written:
My interrogations are: what if I introduce some BC break? Could it be ok to release a new major version with these changes? Should I not introduce any BC issue and restrict the changes and not allow to call commands from another command? @duncan3dc what do you think? |
Hi @Arcesilas, I currently have a few ideas floating around for 4.0. Some of these will include BC breaks so that's not out of the question. We just need to reduce the impact of these breaks as much as possible, give people a clear/easy upgrade path |
Great! Thanks for your answer! |
Here's a very basic example of how multiple subcommands can be handled with CLImate without writing much code: https://gist.github.com/Arcesilas/06abb3b2e94f50b3bdff415b68a3213f This example does not handle the subcommand, it simply extracts it from the arguments list. |
Unless I missed this in the docs, there doesn't seem to be an easy way to set up multiple "commands". The argument parsing is nice, but it would be great to handle multiple commands with seperate argument configurations.
Commander refers to them "Git-style sub-commands".
https://www.npmjs.com/package/commander#git-style-sub-commands
Maybe the symfony/console component would be better for what I'm trying to do, but just thought I'd mention the issue to see if I'm missing something or in case it's something we'd like to add to the roadmap.
The text was updated successfully, but these errors were encountered: