mirror of
https://github.com/quitesimpleorg/hs9001.git
synced 2024-11-24 02:22:36 +01:00
Consider return code when checking if command was already printed
This commit is contained in:
parent
ac9aab63bd
commit
e1375f237c
4
main.go
4
main.go
@ -411,6 +411,7 @@ func main() {
|
|||||||
results := search(conn, opts)
|
results := search(conn, opts)
|
||||||
|
|
||||||
previousCmd := ""
|
previousCmd := ""
|
||||||
|
previousReturn := -1
|
||||||
|
|
||||||
fi, err := os.Stdout.Stat()
|
fi, err := os.Stdout.Stat()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -428,7 +429,7 @@ func main() {
|
|||||||
if !ok {
|
if !ok {
|
||||||
log.Panic("Failed to retrieve entries")
|
log.Panic("Failed to retrieve entries")
|
||||||
}
|
}
|
||||||
if !distinct || previousCmd != entry.cmd {
|
if !distinct || !(previousCmd == entry.cmd && previousReturn == entry.retval) {
|
||||||
prefix := ""
|
prefix := ""
|
||||||
postfix := ""
|
postfix := ""
|
||||||
if printColors && entry.retval != 0 {
|
if printColors && entry.retval != 0 {
|
||||||
@ -438,6 +439,7 @@ func main() {
|
|||||||
fmt.Printf("%s%s%s\n", prefix, entry.cmd, postfix)
|
fmt.Printf("%s%s%s\n", prefix, entry.cmd, postfix)
|
||||||
}
|
}
|
||||||
previousCmd = entry.cmd
|
previousCmd = entry.cmd
|
||||||
|
previousReturn = entry.retval
|
||||||
}
|
}
|
||||||
|
|
||||||
if cmd == "delete" {
|
if cmd == "delete" {
|
||||||
|
Loading…
Reference in New Issue
Block a user