intermodal/src/opt.rs

25 lines
514 B
Rust
Raw Normal View History

2019-05-24 10:25:55 +02:00
use crate::common::*;
use structopt::clap::AppSettings;
2019-05-24 10:25:55 +02:00
#[derive(StructOpt)]
#[structopt(
about(consts::ABOUT),
version(consts::VERSION),
author(consts::AUTHOR),
setting(AppSettings::ColoredHelp),
setting(AppSettings::ColorAuto)
)]
2019-05-24 10:25:55 +02:00
pub(crate) struct Opt {
#[structopt(long = "unstable", short = "u")]
unstable: bool,
#[structopt(subcommand)]
subcommand: Subcommand,
}
impl Opt {
pub(crate) fn run(self, env: &mut Env) -> Result<(), Error> {
2019-05-24 10:25:55 +02:00
self.subcommand.run(env, self.unstable)
}
}