1
0
Fork 0
mirror of https://github.com/archtechx/todo-system.git synced 2025-12-12 09:04:03 +00:00

scan todos in readme.md

This commit is contained in:
Samuel Štancl 2023-11-22 22:13:31 +01:00
parent c708a45ab9
commit 5737232baa
5 changed files with 161 additions and 11 deletions

View file

@ -1,6 +1,7 @@
use std::path::PathBuf;
use clap::Parser;
use scan::scan_readme_file;
use crate::entries::Entry;
use crate::render::render_entries;
use crate::scan::{Stats, scan_dir, scan_todo_file};
@ -44,7 +45,12 @@ fn main() {
for p in args.paths {
let mut path = root_dir.clone();
path.push(p);
if p != "." {
// This isn't necessary and the code works just fine without it
// but it adds unnecessary /./ to the paths in the generated output.
path.push(p);
}
paths.push(path);
}
@ -56,8 +62,6 @@ fn main() {
excludes.push(path);
}
// todo@real logic for readme.md
let mut entries: Vec<Entry> = vec![];
let mut stats = Stats::new();
@ -72,6 +76,13 @@ fn main() {
scan_todo_file(&todos_path, &mut entries).unwrap();
}
let mut readme_path = root_dir.clone();
readme_path.push(&args.readme);
if readme_path.exists() {
scan_readme_file(&readme_path, &mut entries).unwrap();
}
render_entries(entries);
if args.verbose {