Create a proper command-line interface
Create a proper command-line interface to give the user greater control of the script.
Features should include:
- separate library from cli invoker
- usage text
- version text
- pass configuration options
- specify output file or directory
Perhaps we can use a (simple) cli library like:
- https://github.com/leejarvis/slop
- http://trollop.rubyforge.org/
- https://github.com/mdub/clamp
Once this is done, I think we can close https://github.com/asciidoctor/asciidoctor/issues/168.
I would like to help this. Do you have any preference among the three options?
Some data for analysis can be found on Ruby Toolbox:
- slop is the most popular one. It looks similar to Ruby’s built-in optparse.
- trollop has been renamed to optimist.
- clamp is still maintained as well. This is more like a CLI framework, not only an argument-parsing library. Similar to Thor.
By the way, the category Command Line Option Parsers and Scripting Frameworks may have some interesting choices.
I don't like dependencies, so I prefer it be done with Ruby's stdlib. You can find an example to draw from in the kramdown-asciidoc project. See https://github.com/asciidoctor/kramdown-asciidoc/blob/main/lib/kramdown-asciidoc/cli.rb