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:
bth 2026-01-20 13:10:47 -08:00
commit 77e3e23446
5 changed files with 31 additions and 14 deletions

View file

@ -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)