extern crate clap; use clap::{App, Arg, SubCommand}; use std::io; mod cli; fn main() -> io::Result<()> { let matches = App::new("gist") .version("0.0.1") .subcommand( SubCommand::with_name("new") .about("Creates a new gist") .arg( Arg::with_name("title") .long("title") .short("t") .takes_value(true) .required(true) .help("The title of the gist"), ) .arg( Arg::with_name("file") .long("file") .short("file") .takes_value(true) .help("The file to use as the body of the gist"), ), ) .get_matches(); if let Some(matches) = matches.subcommand_matches("new") { cli::new_gist(&matches)?; } Ok(()) }