nk412 / optparse

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

Fails to parse option argument or throw a relevant error under specific condition #14

Open skvskv opened 8 years ago

skvskv commented 8 years ago

Here's an example:

$ ./a.sh -v -L wfrge
Would get: 
    scp  -P22334 wfrge@81.1.210.123:/opt/scripts/db/.backup 
To: 
    /vagrant/db/.backup

$ ./a.sh -v 1 -L wfrge
SSH login is required option.

For help invoke with -? or --help 

The definitions of the options is as the following:

optparse.define short=L long=ssh-login desc="The login to use for sftp/scp connection" variable=ssh_login
optparse.define short=v long=verbose desc="" desc="Verbose mode." variable=verbose value=1 default=0

Works same way if long option name specified.