Support -r=foo syntax

This commit is contained in:
morganamilo 2018-08-02 14:43:54 +01:00
parent 4e67c1e886
commit 97006ade19
No known key found for this signature in database
GPG Key ID: 6FE9E7996B0B082E

View File

@ -735,9 +735,16 @@ func (parser *arguments) parseShortOption(arg string, param string) (usedNext bo
for k, _char := range arg {
char := string(_char)
if hasParam(char) {
if k < len(arg)-2 {
if k < len(arg)-1 {
if arg[k+1] == '=' {
err = parser.addParam(char, arg[k+2:])
break
}
}
if hasParam(char) {
if k < len(arg)-1 {
err = parser.addParam(char, arg[k+1:])
} else {
usedNext = true
err = parser.addParam(char, param)