1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use structopt::StructOpt;

#[derive(StructOpt, Debug)]
#[structopt(name = "scripts")]
pub struct Opt {
    #[structopt(subcommand)]
    pub cmd: Cmd,
}

#[derive(StructOpt, Debug)]
#[structopt(about = "which subcommand to run")]
pub enum Cmd {
    DeployExamples,
    DockerInit,
    DockerUp,
    RunBench,
    BuildContracts(BuildContracts),
    BuildDocs,
    RunExamples,
    RunTests(RunTestsCmd),
}

#[derive(StructOpt, Debug)]
pub struct BuildContracts {
    /// The package to build
    #[structopt(short = "p", long = "package")]
    pub package: Option<String>,
    #[structopt(long = "wasm-opt")]
    pub wasm_opt: bool,
}

#[derive(StructOpt, Debug)]
pub struct RunTestsCmd {
    #[structopt(long = "wasm-opt")]
    pub wasm_opt: bool,
}