davetron5000 / optparse-plus

Start your command line scripts off right in Ruby
http://davetron5000.github.com/optparse-plus
Apache License 2.0
521 stars 54 forks source link

Implement multi-level commands for git-like CLI #95

Closed juhazi closed 8 years ago

juhazi commented 9 years ago

Includes all the relevant changes cleaned and rebased to v1.9.1 from https://github.com/dennisjbell/methadone-clinic . Dividing this into meaningful atomic commits was not feasible. Temporarily, we are maintaining this as our own fork at https://github.com/enemy/methadone-rehab.

Without fully integrated subcommand support, users are reduced to rolling their own and implementing large if-else trees as can be seen in https://jonbake.com/blog/a-walk-through-of-creating-a-command-line-application-in-ruby/ and https://github.com/jonmbake/command-line-favs/blob/master/lib/fav.rb

List of Changes:

List of Contributors: @juhazi @matti

davetron5000 commented 9 years ago

I'm definitely not keen to add subcommand support to this gem, as that's not its purpose. GLI should be used for that. Is there any reason you can't use that instead of forking this gem? Some of the other changes look interesting, but the subcommand support isn't something I really want in this gem.

juhazi commented 9 years ago

GLI did not look as active as methadone and also seems to be missing features included in methadone(such as Methadone::SH or logging in general). Are they implemented differently in GLI?

With subcommand support you could have only one CLI development framework instead of two.

davetron5000 commented 9 years ago

GLI is actively maintained, just relatively stable. I would like to have the SH and logging stuff from Methadone in GLI, but I haven't gotten around to it. Any GLI app could mix these into itself, though.

Honestly, I do not have the ability to support two subcommand-based CLI utilities. This feature will open up a world of new bugs, new feature requests, and require a ton of documentation and tests, all of which I feel I've more or less solved in GLI. Methadone was only intended when you just want something simple and would normally use OptionParser.

dennisjbell commented 8 years ago

juhazi,

Feel free to make a PR against my repo and we'll see what we can accomplish. It's been a while since I synced up with methadone repo, but if someone else want's to help me keep up and extend the multi-level commands, we can keep it a viable option.

With all due respect and thanks to Dave for making methadone and GLI, and respecting his wish to keep methadone single-level, I similarly prefer to have multi-level commands in methadone than use GLI (methadone seems a more compatible framework for the way my mind works) and would love to have others that feel the same way have the opportunity to use it.

-Dennis

juhazi commented 8 years ago

Hi Dennis,

PR is created.

davetron5000 commented 8 years ago

Sounds like your fork is working, so I'm gonna close this one here.