last and sort should pipe to stdout
This commit is contained in:
parent
59b0c173aa
commit
b5075786c6
3 changed files with 6 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ package next
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
@ -45,5 +46,6 @@ func Last() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("um last: %v", err)
|
log.Fatalf("um last: %v", err)
|
||||||
}
|
}
|
||||||
log.Println(s)
|
// send to stdout, not stderr as is default for log.Print:
|
||||||
|
fmt.Println(s)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,8 @@ func emacsNext(f string, tags string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
// NOTE: sends to stderr : is this what we want?
|
||||||
|
// if we decide to pipe the filename out, yes.
|
||||||
log.Print(string(out))
|
log.Print(string(out))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,7 @@ func Sort(args []string) {
|
||||||
if opts.Write.Val {
|
if opts.Write.Val {
|
||||||
Write(opts.Key.Val, out)
|
Write(opts.Key.Val, out)
|
||||||
} else {
|
} else {
|
||||||
|
// to stdout
|
||||||
fmt.Print(out)
|
fmt.Print(out)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue