use clap::{App, ArgMatches, Arg}; pub fn get_matches() -> ArgMatches<'static> { let matches = App::new("backrest") .version("0.1.0") .author("neallred <neallred@protonmail.com") .about("create backups and restore from them") .subcommand(App::new("backup") .about("create backups") .arg(Arg::with_name("backdir") .long("backdir") .takes_value(true) .help("directory in which to place backups") ) .arg(Arg::with_name("patterns") .long("patterns") .multiple(true) .required(true) .index(1) .help("patterns to use to search backups to create") ) ) .subcommand(App::new("restore") .about("restore from backup") .arg(Arg::with_name("backups") .long("backups") .multiple(true) .required(true) .index(1) .help("backup files to restore from") ) .arg(Arg::with_name("dest") .long("dest") .required(true) .takes_value(true) .help("folder into which backups will be built out") ) ) .get_matches(); matches }