added markdown output

This commit is contained in:
specCon18 2025-03-17 13:55:52 -04:00
parent 164d84c391
commit 688a65b4c9

View file

@ -47,7 +47,7 @@ Usage:
path, _ := cmd.Flags().GetString("path")
if path != "" {
comments := readFileTree(path)
fmt.Println(comments)
mdTableFormatter(comments)
} else {
fmt.Println("ERROR: No path provided, please provide path using the -p flag")
os.Exit(1)
@ -138,3 +138,12 @@ func readFileTree(path string) []Comment {
})
return comments
}
func mdTableFormatter(comments []Comment) {
fmt.Println("| File Path | Line Number | Priority | Task |")
fmt.Println("| --------- | ----------- | -------- | ---- |")
for _, comment := range comments {
// You can access each `comment` here
fmt.Printf("| %s | %d | %d | %s |\n",comment.FilePath,comment.LineNumber,comment.Priority,comment.Task)
}
}