mirror of
https://github.com/cyborg42/epub2mdbook.git
synced 2026-02-10 16:24:50 -05:00
21 lines
No EOL
551 B
Rust
21 lines
No EOL
551 B
Rust
use std::path::PathBuf;
|
|
|
|
use clap::Parser;
|
|
use epub2mdbook::{convert_epub_to_mdbook, error::Error};
|
|
|
|
#[derive(Parser)]
|
|
struct Args {
|
|
/// The path to the input EPUB file
|
|
#[clap(short, long)]
|
|
input_epub: PathBuf,
|
|
/// The path to the output directory, working directory by default
|
|
#[clap(short, long)]
|
|
output_dir: Option<PathBuf>,
|
|
}
|
|
|
|
fn main() -> Result<(), Error> {
|
|
let args = Args::parse();
|
|
convert_epub_to_mdbook(args.input_epub, args.output_dir, true)?;
|
|
println!("Conversion completed successfully!");
|
|
Ok(())
|
|
} |