optparse icon indicating copy to clipboard operation
optparse copied to clipboard

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

Open skvskv opened this issue 9 years ago • 0 comments

Here's an example:

$ ./a.sh -v -L wfrge
Would get: 
    scp  -P22334 [email protected]:/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.

skvskv avatar Mar 28 '16 10:03 skvskv