README.md

Optparse

A BASH wrapper for getopts, for simple command-line argument parsing

What is this?

A wrapper that provides a clean and easy way to parse arguments to your BASH scripts. It lets you define short and long option names, handle flag variables, and set default values for optional arguments, all while aiming to be as minimal as possible: One line per argument definition.

Usage

See sample_head.sh for a demonstration of optparse

1. Define your arguments

Each argument to the script is defined with optparse.define, which specifies the option names, a short description, the variable it sets and the default value (if any).