Merge pull request #372 from Morganamilo/fixparsercheck

Fix warning by megacheck in parser
This commit is contained in:
Anna 2018-04-27 02:49:19 +01:00 committed by GitHub
commit 37b08eabf7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -220,9 +220,12 @@ func (parser *arguments) getArg(options ...string) (arg string, double bool, exi
existCount := 0
for _, option := range options {
_, exists = parser.options[option]
var value string
value, exists = parser.options[option]
if exists {
arg = value
existCount++
_, exists = parser.doubles[option]
@ -232,9 +235,10 @@ func (parser *arguments) getArg(options ...string) (arg string, double bool, exi
}
arg, exists = parser.globals[option]
value, exists = parser.globals[option]
if exists {
arg = value
existCount++
_, exists = parser.doubles[option]