diff options
| author | Paul Buetow <paul@buetow.org> | 2025-01-03 10:12:02 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-01-03 10:12:02 +0200 |
| commit | a35f0ed04c28d80b902a00c3aec84dd86db34e85 (patch) | |
| tree | b9632f61192d40c3c9fe1e32c2744c91e0ba13de | |
| parent | 5cacdd83fcd28e71f798cac628b5dd602fadef50 (diff) | |
add warning when there is no hashtag
| -rw-r--r-- | internal/colour/colour.go | 2 | ||||
| -rw-r--r-- | internal/entry/entry.go | 2 | ||||
| -rw-r--r-- | internal/queue/queue.go | 8 |
3 files changed, 7 insertions, 5 deletions
diff --git a/internal/colour/colour.go b/internal/colour/colour.go index 54cb1d9..b5f2681 100644 --- a/internal/colour/colour.go +++ b/internal/colour/colour.go @@ -14,5 +14,7 @@ var ( Info2f = info2Col.PrintfFunc() SInfo2f = info2Col.SprintfFunc() Ackf = color.New(color.FgBlack, color.BgHiYellow, color.Bold).PrintfFunc() + warnCol = color.New(color.FgHiWhite, color.BgRed) + Warnf = warnCol.PrintfFunc() Successf = color.New(color.FgWhite, color.BgGreen).PrintfFunc() ) diff --git a/internal/entry/entry.go b/internal/entry/entry.go index 600dbc4..509ddfe 100644 --- a/internal/entry/entry.go +++ b/internal/entry/entry.go @@ -193,7 +193,7 @@ func (en Entry) Remove() error { } func (en Entry) FileAction(question string) error { - content, _, err := en.Content() + content, err := oi.SlurpAndTrim(en.Path) if err != nil { return err } diff --git a/internal/queue/queue.go b/internal/queue/queue.go index 33b5bf7..43a017c 100644 --- a/internal/queue/queue.go +++ b/internal/queue/queue.go @@ -50,10 +50,10 @@ func queueEntries(args config.Args) error { return err } if !hasHashtags { - if err := en.FileAction("Do you want to queue this despite there are no Hashtags?"); err != nil { - return err - } - } else if en.HasTag("ask") { + colour.Warnf("The following entry has got no hashtags:") + fmt.Printf("\n") + } + if !hasHashtags || en.HasTag("ask") { if err := en.FileAction("Do you want to queue this"); err != nil { return err } |
