zola/src/cli.rs

25 lines
913 B
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")
)
(@subcommand serve =>
(about: "Serve the site. Rebuild and reload on change automatically")
(@arg interface: "Interface to bind on (default to 127.0.0.1)")
(@arg port: "Which port to use (default to 1111)")
)
)
}