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.

25 lines
913B

  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. )
  16. (@subcommand serve =>
  17. (about: "Serve the site. Rebuild and reload on change automatically")
  18. (@arg interface: "Interface to bind on (default to 127.0.0.1)")
  19. (@arg port: "Which port to use (default to 1111)")
  20. )
  21. )
  22. }