Open rejeep opened 10 years ago
I would also like the ability to do recursive options, i.e. put options to commands, such that I can write for example
cask install --no-dev
but not
cask --no-dev pkg-file
In other words, the options should be scoped to the commands.
This is a good place to steal some ideas, I like the yargs way quite a lot. We can lispify it a bit of course: https://github.com/yargs/yargs/blob/master/docs/api.md
Holy moly, quite advanced stuff
I'd really like to use commander for https://github.com/emacs-elsa/Elsa so I'm probably going to build at least the things I will need and we can extend later of course :)
Feel free to add the extensions you want!
Just a bit of warning before you dig into the code. When I wrote this I was working on Ecukes. I needed a CLI option parser for Elisp, but to my surprise there was none. So I wrote this as fast as possible just to get something.
That said, the code I wrote is not the prettiest, I just made it work. The tests should be fairly good though since I figured I might end up refactoring the code at some point (never happened).
Good luck! 🙂
Allow for more complex patterns for options and commands, for example:
And more. And same as above for options.