docbookrx icon indicating copy to clipboard operation
docbookrx copied to clipboard

Create a proper command-line interface

Open mojavelinux opened this issue 11 years ago • 4 comments

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

mojavelinux avatar May 21 '14 01:05 mojavelinux

Perhaps we can use a (simple) cli library like:

  • https://github.com/leejarvis/slop
  • http://trollop.rubyforge.org/
  • https://github.com/mdub/clamp

mojavelinux avatar Dec 06 '15 07:12 mojavelinux

Once this is done, I think we can close https://github.com/asciidoctor/asciidoctor/issues/168.

mojavelinux avatar Apr 20 '16 01:04 mojavelinux

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.
    • Homepage mentions clip (probably dead) and main (less popular).

By the way, the category Command Line Option Parsers and Scripting Frameworks may have some interesting choices.

FranklinYu avatar Jun 05 '20 04:06 FranklinYu

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

mojavelinux avatar Oct 12 '23 08:10 mojavelinux