use structopt::StructOpt;
#[derive(Debug, StructOpt)]
#[structopt(name = "script_runner", about = "A command-line script runner")]
struct Opt {
#[structopt(short = "h", long = "help")]
help: bool,
#[structopt(short = "v", long = "version")]
version: bool,
#[structopt(short = "V", long = "verbose")]
verbose: bool,
#[structopt(short = "t", long = "timings")]
timings: bool,
#[structopt(long = "generate")]
generate: bool,
#[structopt(long = "build")]
build: bool,
script: Option<String>,
#[structopt(name = "SCRIPT_ARGS", parse(from_str))]
script_args: Vec<String>,
}
let opt = Opt::from_args();
if opt.help {
println!("{:?}",Opt::clap().print_help()?);
} else if opt.version {
println!("Script Runner v0.1");
} else if opt.script.is_some() {
println!("Script to run: {:?}", opt.script);
println!("Arguments for the script to run: {:?}", opt.script_args);
println!("Put script run code here");
} else {
println!("Verbose mode: {}", opt.verbose);
println!("Show timings: {}", opt.timings);
println!("Generate: {}", opt.generate);
println!("Build: {}", opt.build);
}