You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mkbook/src/cli.rs

33 lines
1.2 KiB
Rust

use clap::{App, Arg, SubCommand};
pub fn build_cli() -> App<'static, 'static> {
App::new(env!("CARGO_PKG_NAME"))
.version(env!("CARGO_PKG_VERSION"))
.author(env!("CARGO_PKG_AUTHORS"))
.about(env!("CARGO_PKG_DESCRIPTION"))
.subcommand(SubCommand::with_name("init")
.about("initialized the directory structi")
)
.subcommand(SubCommand::with_name("init")
.about("initialize a mkbook directory tree")
.arg(Arg::with_name("directory")
.help("an optional directory to initialize into (defaults to the CWD)")
)
)
.subcommand(SubCommand::with_name("build")
.about("build the book")
.arg(Arg::with_name("in")
.short("i")
.long("in")
.default_value("src")
.help("an optional directory to take the book sources from")
)
.arg(Arg::with_name("out")
.short("o")
.long("out")
.default_value("book")
.help("an optional directory to render the contents into")
)
)
}