mirror of
https://github.com/Jguer/yay
synced 2024-08-31 05:39:29 +00:00
Count from 0 on upgrade prompt
This commit is contained in:
parent
479e2f0ce0
commit
91662d7e9d
12
upgrade.go
12
upgrade.go
|
@ -301,8 +301,8 @@ func upgradePkgs(flags []string) error {
|
|||
var aurNums []int
|
||||
sort.Sort(repoUp)
|
||||
fmt.Printf("\x1b[1;34;1m:: \x1b[0m\x1b[1m%d Packages to upgrade.\x1b[0m\n", len(aurUp)+len(repoUp))
|
||||
repoUp.Print(len(aurUp))
|
||||
aurUp.Print(0)
|
||||
repoUp.Print(len(aurUp) + 1)
|
||||
aurUp.Print(1)
|
||||
|
||||
if !config.NoConfirm {
|
||||
fmt.Print("\x1b[32mEnter packages you don't want to upgrade.\x1b[0m\nNumbers: ")
|
||||
|
@ -333,17 +333,17 @@ func upgradePkgs(flags []string) error {
|
|||
numbers = []int{num}
|
||||
}
|
||||
for _, target := range numbers {
|
||||
if target > len(aurUp)+len(repoUp)-1 || target < 0 {
|
||||
if target > len(aurUp)+len(repoUp) || target <= 0 {
|
||||
continue
|
||||
} else if target < len(aurUp) {
|
||||
target = len(aurUp) - target - 1
|
||||
} else if target <= len(aurUp) {
|
||||
target = len(aurUp) - target
|
||||
if negate {
|
||||
excludeAur = append(excludeAur, target)
|
||||
} else {
|
||||
aurNums = append(aurNums, target)
|
||||
}
|
||||
} else {
|
||||
target = len(aurUp) + len(repoUp) - target - 1
|
||||
target = len(aurUp) + len(repoUp) - target
|
||||
if negate {
|
||||
excludeRepo = append(excludeRepo, target)
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue