#[macro_use]
extern crate structopt;
use structopt::StructOpt;
#[derive(StructOpt, Debug)]
#[structopt(name = "basic")]
struct Opt {
#[structopt(short = "f", long = "first-flag")]
first_flag: bool,
#[structopt(short = "s", long = "second-flag")]
second_flag: bool,
#[structopt(
short = "t",
long = "third-flag",
long_help = r"This is a raw string.
It can be used to pass well formatted content (e.g. lists or source
code) in the description:
- first example list entry
- second example list entry
"
)]
third_flag: bool,
#[structopt(subcommand)]
sub_command: SubCommand,
}
#[derive(StructOpt, Debug)]
#[structopt()]
enum SubCommand {
#[structopt(name = "first")]
First,
#[structopt(name = "second")]
Second,
}
fn main() {
let opt = Opt::from_args();
println!("{:?}", opt);
}