Generate ruby optparse
code from usage text.
This project generates valid optparse
code from a given program's usage text.
Currently, optparsegen only supports scopt formatted usage text.
This project is published as a ruby gem.
The simplest way to install it is with gem install
.
gem install optparsegen
optparsegen will read from standard input unless a filename is passed as an argument. Generated code is printed to standard output.
Typical usage looks like:
java -jar some-scopt-using.jar --help | optparsegen > optparse.rb
Usage: optparsegen [options] <file>
optparsegen converts program usage text into equivalent ruby 'optparse'
code. It reads the text from the filename passed as the only argument
on the command line or from standard input.
Example:
java -jar some-scopt-using.jar --help | optparsegen > optparse.rb
Options:
-f, --format=[FORMAT] Input usage text format. Default: scopt
-h, --help Show this message.