1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
mod opt;

use std::ffi::OsString;
use structopt::StructOpt;
use opt::Opt;

pub fn command<I: IntoIterator>(parts: I) -> i32 where I::Item: Into<OsString> + Clone {
    let opt: Opt = Opt::from_iter(parts);
    use Opt::*;
    match opt {
        Run     { options, run_options } => crate::run(options, run_options),
        Compile { options, compile_options } => crate::compile(options, compile_options),
    }
}