tag : use IsSet

This commit is contained in:
bth 2026-01-20 14:51:51 -08:00
commit fb25a2bb43

View file

@ -57,14 +57,14 @@ func Tag(args []string) {
entries := entriesGlobOrStdin() entries := entriesGlobOrStdin()
// we shrink the entries list immediately if we want a date range: // we shrink the entries list immediately if we want a date range:
if opts.Date.Val != "" { if opts.Date.IsSet() {
entries = dateRange(entries, opts.Date.Val) entries = dateRange(entries, opts.Date.Val)
} }
tagmap := makeTagmap(entries) tagmap := makeTagmap(entries)
// processQueries must precede invert because we want invert to respect combined tags: // processQueries must precede invert because we want invert to respect combined tags:
files := processQueries(tagmap, queries) files := processQueries(tagmap, queries)
if opts.Invert.Val { if opts.Invert.IsSet() {
files = invert(entries, files) files = invert(entries, files)
} }
// NOTE: the full makeAdjacencies map may one day be useful on its own // NOTE: the full makeAdjacencies map may one day be useful on its own