Skip to content
This repository has been archived by the owner on Jun 2, 2018. It is now read-only.

Latest commit

 

History

History
52 lines (30 loc) · 1.27 KB

README.md

File metadata and controls

52 lines (30 loc) · 1.27 KB

optparsegen

Build Status

Generate ruby optparse code from usage text.

Overview

This project generates valid optparse code from a given program's usage text.

Currently, optparsegen only supports scopt formatted usage text.

Installation

This project is published as a ruby gem.

The simplest way to install it is with gem install.

gem install optparsegen

Usage

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

Options

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.