The CLI frontend to a gist server written in Rust
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.

main.rs 1004B

12345678910111213141516171819202122232425262728293031323334353637
  1. extern crate clap;
  2. use clap::{App, Arg, SubCommand};
  3. use std::io;
  4. mod cli;
  5. fn main() -> io::Result<()> {
  6. let matches = App::new("gist")
  7. .version("0.0.1")
  8. .subcommand(
  9. SubCommand::with_name("new")
  10. .about("Creates a new gist")
  11. .arg(
  12. Arg::with_name("title")
  13. .long("title")
  14. .short("t")
  15. .takes_value(true)
  16. .required(true)
  17. .help("The title of the gist"),
  18. )
  19. .arg(
  20. Arg::with_name("file")
  21. .long("file")
  22. .short("file")
  23. .takes_value(true)
  24. .help("The file to use as the body of the gist"),
  25. ),
  26. )
  27. .get_matches();
  28. if let Some(matches) = matches.subcommand_matches("new") {
  29. cli::new_gist(&matches)?;
  30. }
  31. Ok(())
  32. }