zola/src/cli.rs

26 lines
1.1 KiB
Rust
Raw Normal View History

2017-07-15 04:24:31 +00:00
use clap::App;
pub fn build_cli() -> App<'static, 'static> {
clap_app!(Gutenberg =>
(version: crate_version!())
(author: "Vincent Prouillet")
(about: "Static site generator")
(@setting SubcommandRequiredElseHelp)
(@arg config: -c --config +takes_value "Path to a config file other than config.toml")
(@subcommand init =>
(about: "Create a new Gutenberg project")
2017-07-27 09:24:43 +00:00
(@arg name: +required "Name of the project. Will create a new directory with that name in the current directory")
2017-07-15 04:24:31 +00:00
)
(@subcommand build =>
(about: "Builds the site")
(@arg base_url: -u --base-url +takes_value "Force the base URL to be that value (default to the one in config.toml)")
2017-07-15 04:24:31 +00:00
)
(@subcommand serve =>
(about: "Serve the site. Rebuild and reload on change automatically")
(@arg interface: -i --interface +takes_value "Interface to bind on (default to 127.0.0.1)")
(@arg port: -p --port +takes_value "Which port to use (default to 1111)")
2017-07-15 04:24:31 +00:00
)
)
}