flags : more common help functions, but redefining the subcmds in each package is probably wrong, esp. since last had to be deduped
This commit is contained in:
parent
0ff9e6d9a3
commit
77e3e23446
5 changed files with 31 additions and 14 deletions
|
|
@ -10,6 +10,9 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
// but this stinks:
|
||||
const lcmd = "last"
|
||||
|
||||
const (
|
||||
// NOTE: the -r flag:
|
||||
LS_CMD = `ls -r [0-9]*.md`
|
||||
|
|
@ -44,7 +47,7 @@ func last() (string, error) {
|
|||
func Last() {
|
||||
s, err := last()
|
||||
if err != nil {
|
||||
log.Fatalf("um last: %v", err)
|
||||
log.Fatalf("um %s: %v", lcmd, err)
|
||||
}
|
||||
// send to stdout, not stderr as is default for log.Print:
|
||||
fmt.Println(s)
|
||||
|
|
|
|||
Loading…
Reference in a new issue