Add longest-shortest-path command

This commit is contained in:
Joscha 2022-10-23 01:14:38 +02:00
parent 1265dd4a41
commit 60ba7721db
3 changed files with 178 additions and 0 deletions

View file

@ -23,6 +23,10 @@ enum Command {
#[clap(short, long)]
flip: bool,
},
/// Find the longest shortest path starting at an article.
LongestShortestPath {
from: String,
},
// Print all page titles.
ListPages,
}
@ -46,6 +50,9 @@ fn main() -> io::Result<()> {
commands::path::path(&args.datafile, &from, &to)
}
}
Command::LongestShortestPath { from } => {
commands::longest_shortest_path::run(&args.datafile, &from)
}
Command::ListPages => commands::list_pages::run(&args.datafile),
}
}