last : move to its own pkg for sharing of GLOB pattern and --help, slightly overkill but consistent

This commit is contained in:
bth 2026-01-20 19:55:03 -08:00
commit c2412caba6
6 changed files with 80 additions and 51 deletions

View file

@ -14,9 +14,6 @@ import (
)
const (
// TODO: source in common with last.go
GLOB = "[0-9]*.md"
// The layout string must be a representation of:
// Jan 2 15:04:05 2006 MST
// 1 2 3 4 5 6 -7

View file

@ -5,6 +5,7 @@ import (
cmdpkg "github.com/brtholomy/um/go/cmd"
"github.com/brtholomy/um/go/flags"
"github.com/brtholomy/um/go/last"
)
// just so that copied calls into flags.Help don't have to be adjusted between files:
@ -54,7 +55,7 @@ func parseArgs(args []string) options {
func Tag(args []string) {
opts := parseArgs(args)
queries := parseQuery(opts.Query.Val)
entries := entriesGlobOrStdin(GLOB)
entries := entriesGlobOrStdin(last.GLOB)
// we shrink the entries list immediately if we want a date range:
if opts.Date.IsSet() {