style(parser): simplify ignore option adding

This commit is contained in:
jguer 2020-07-26 23:48:33 +02:00
parent de92f24ce5
commit 991c5b4146
No known key found for this signature in database
GPG key ID: 6D6CC9BEA8556B35

View file

@ -174,11 +174,7 @@ func install(cmdArgs *settings.Arguments, alpmHandle *alpm.Handle, ignoreProvide
cmdArgs.Op = "S" cmdArgs.Op = "S"
cmdArgs.DelArg("y", "refresh") cmdArgs.DelArg("y", "refresh")
if arguments.ExistsArg("ignore") { if arguments.ExistsArg("ignore") {
if cmdArgs.ExistsArg("ignore") { cmdArgs.CreateOrAppendOption("ignore", arguments.GetArgs("ignore")...)
cmdArgs.Options["ignore"].Args = append(cmdArgs.Options["ignore"].Args, arguments.Options["ignore"].Args...)
} else {
cmdArgs.Options["ignore"] = arguments.Options["ignore"]
}
} }
return show(passToPacman(cmdArgs)) return show(passToPacman(cmdArgs))
} }