1
0
Fork 0
mirror of https://github.com/vbatts/freezing-octo-hipster.git synced 2024-11-22 06:55:39 +00:00

find-todos: update to markdown pattern

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2017-08-24 15:43:33 -04:00
parent 21a6bd6d87
commit b898fc1bf5
Signed by: vbatts
GPG key ID: 10937E57733F1362

View file

@ -28,7 +28,7 @@ func main() {
NoteDir = filepath.Join(os.Getenv("HOME"), "Notes") NoteDir = filepath.Join(os.Getenv("HOME"), "Notes")
} }
flNoteDir = flag.String("d", NoteDir, "directory of notes") flNoteDir = flag.String("d", NoteDir, "directory of notes")
flNotePat = flag.String("p", "Tasks*.txt", "file pattern") flNotePat = flag.String("p", "Tasks*.md", "file pattern")
flag.Parse() flag.Parse()
matches, err := filepath.Glob(filepath.Join(*flNoteDir, *flNotePat)) matches, err := filepath.Glob(filepath.Join(*flNoteDir, *flNotePat))
@ -54,7 +54,7 @@ func main() {
fmt.Println(err) fmt.Println(err)
os.Exit(1) os.Exit(1)
} }
count += 1 count++
if strings.Contains(line, "TODO") { if strings.Contains(line, "TODO") {
fmt.Printf("%s:%d\t%s\n", filepath.Base(match), count, strings.TrimRight(line, " \n")) fmt.Printf("%s:%d\t%s\n", filepath.Base(match), count, strings.TrimRight(line, " \n"))
trimmed := strings.TrimSpace(line) trimmed := strings.TrimSpace(line)