Add --flip flag to path command
This commit is contained in:
parent
d5f55d2855
commit
a7b9849183
1 changed files with 10 additions and 1 deletions
|
|
@ -19,6 +19,9 @@ enum Command {
|
||||||
Path {
|
Path {
|
||||||
from: String,
|
from: String,
|
||||||
to: String,
|
to: String,
|
||||||
|
/// Flip start and end article.
|
||||||
|
#[clap(short, long)]
|
||||||
|
flip: bool,
|
||||||
},
|
},
|
||||||
// Print all page titles.
|
// Print all page titles.
|
||||||
ListPages,
|
ListPages,
|
||||||
|
|
@ -36,7 +39,13 @@ fn main() -> io::Result<()> {
|
||||||
match args.command {
|
match args.command {
|
||||||
Command::Ingest => commands::ingest::ingest(&args.datafile),
|
Command::Ingest => commands::ingest::ingest(&args.datafile),
|
||||||
Command::Reexport { to } => commands::reexport::reexport(&args.datafile, &to),
|
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),
|
Command::ListPages => commands::list_pages::run(&args.datafile),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue