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

26 lines
1.1KB

  1. use clap::App;
  2. pub fn build_cli() -> App<'static, 'static> {
  3. clap_app!(Gutenberg =>
  4. (version: crate_version!())
  5. (author: "Vincent Prouillet")
  6. (about: "Static site generator")
  7. (@setting SubcommandRequiredElseHelp)
  8. (@arg config: -c --config +takes_value "Path to a config file other than config.toml")
  9. (@subcommand init =>
  10. (about: "Create a new Gutenberg project")
  11. (@arg name: +required "Name of the project. Will create a new directory with that name in the current directory")
  12. )
  13. (@subcommand build =>
  14. (about: "Builds the site")
  15. (@arg base_url: -u --base-url +takes_value "Force the base URL to be that value (default to the one in config.toml)")
  16. )
  17. (@subcommand serve =>
  18. (about: "Serve the site. Rebuild and reload on change automatically")
  19. (@arg interface: -i --interface +takes_value "Interface to bind on (default to 127.0.0.1)")
  20. (@arg port: -p --port +takes_value "Which port to use (default to 1111)")
  21. )
  22. )
  23. }