nk412 / optparse

Simple command line arguments parser for BASH
MIT License
158 stars 32 forks source link

Alignment for usage #8

Open K-Ko opened 10 years ago

K-Ko commented 10 years ago

The arguments help is differerent aligned than the "default" help description.

Test:

#!/bin/bash
. optparse.bash

optparse.define short=T long=test desc='Test run' variable=TEST default=false

source $( optparse.build )

echo "$@"

Result:

 # ./t.sh --help
 usage: ./t.sh [OPTIONS]
 OPTIONS:

 -T --test:                             Test run [default:false]
 -? --help : usage