structopt 0.3.8

Parse command line argument by defining a struct.
Documentation
use structopt::StructOpt;

#[derive(StructOpt, Debug)]
struct Opt {
    #[structopt(subcommand)]
    cmd: Command,
}

#[derive(StructOpt, Debug)]
enum Command {
    #[structopt(external_subcommand)]
    Run(Vec<String>),

    #[structopt(external_subcommand)]
    Other(Vec<String>)
}

fn main() {
    let opt = Opt::from_args();
    println!("{:?}", opt);
}