mirror of
https://github.com/Jguer/yay
synced 2024-10-31 04:12:51 +00:00
chore(alpm): use text.getinput for ialpm
This commit is contained in:
parent
9eb73899fe
commit
57a9630054
1 changed files with 4 additions and 14 deletions
|
@ -1,7 +1,6 @@
|
||||||
package ialpm
|
package ialpm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
@ -191,28 +190,19 @@ func (ae *AlpmExecutor) questionCallback() func(question alpm.QuestionAny) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
reader := bufio.NewReader(os.Stdin)
|
numberBuf, err := text.GetInput("", false)
|
||||||
|
|
||||||
numberBuf, overflow, err := reader.ReadLine()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
text.Errorln(err)
|
text.Errorln(err)
|
||||||
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if overflow {
|
if numberBuf == "" {
|
||||||
text.Errorln(gotext.Get(" Input too long"))
|
|
||||||
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if string(numberBuf) == "" {
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
num, err := strconv.Atoi(string(numberBuf))
|
num, err := strconv.Atoi(numberBuf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
text.Errorln(gotext.Get("invalid number: %s", string(numberBuf)))
|
text.Errorln(gotext.Get("invalid number: %s", numberBuf))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue