Add watch mode functionality to Slinky for real-time link checking

This update introduces a watch mode that monitors file changes and automatically re-scans for broken links. The feature enhances the user experience during development by providing real-time updates and ensuring links remain valid as files are modified. Additionally, the README has been updated to include usage instructions and details about the new watch mode capabilities.
This commit is contained in:
Luke Hagar
2025-09-23 19:26:00 +00:00
parent 5ff8337397
commit 4fb0c9b375
9 changed files with 384 additions and 30 deletions

View File

@@ -45,7 +45,7 @@ func init() {
}
}
return tui.Run(root, gl, cfg, jsonOut, mdOut)
return tui.Run(root, gl, cfg, jsonOut, mdOut, watchMode)
},
}
@@ -53,6 +53,7 @@ func init() {
runCmd.Flags().StringVar(&jsonOut, "json-out", "", "path to write full JSON results (array)")
runCmd.Flags().StringVar(&mdOut, "md-out", "", "path to write Markdown report for PR comment")
runCmd.Flags().StringVar(&repoBlobBase, "repo-blob-base", "", "override GitHub blob base URL (e.g. https://github.com/owner/repo/blob/<sha>)")
runCmd.Flags().BoolVar(&watchMode, "watch", false, "watch for file changes and automatically re-scan")
rootCmd.AddCommand(runCmd)
}
@@ -60,4 +61,5 @@ var (
maxConcurrency int
jsonOut string
mdOut string
watchMode bool
)