From a7b9849183d52a003496ffa14d5fd1a11041887e Mon Sep 17 00:00:00 2001 From: Joscha Date: Sat, 22 Oct 2022 20:46:26 +0200 Subject: [PATCH] Add --flip flag to path command --- brood/src/main.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/brood/src/main.rs b/brood/src/main.rs index 06fa4ce..8ba6186 100644 --- a/brood/src/main.rs +++ b/brood/src/main.rs @@ -19,6 +19,9 @@ enum Command { Path { from: String, to: String, + /// Flip start and end article. + #[clap(short, long)] + flip: bool, }, // Print all page titles. ListPages, @@ -36,7 +39,13 @@ fn main() -> io::Result<()> { match args.command { Command::Ingest => commands::ingest::ingest(&args.datafile), Command::Reexport { to } => commands::reexport::reexport(&args.datafile, &to), - Command::Path { from, to } => commands::path::path(&args.datafile, &from, &to), + Command::Path { from, to, flip } => { + if flip { + commands::path::path(&args.datafile, &to, &from) + } else { + commands::path::path(&args.datafile, &from, &to) + } + } Command::ListPages => commands::list_pages::run(&args.datafile), } }