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
37
38
39
40
41
42
43
44
45
46
47
use anyhow::{Context, Result};
use std::path::PathBuf;
use structopt::StructOpt;
pub mod build;
pub mod cfg;
pub mod clean;
pub mod config;
pub mod serve;
pub mod translate;
pub mod watch;
#[derive(StructOpt)]
#[structopt(name = "trunk")]
pub struct Trunk {
#[structopt(subcommand)]
pub action: TrunkSubcommands,
#[structopt(long, parse(from_os_str), env = "TRUNK_CONFIG")]
pub config: Option<PathBuf>,
#[structopt(short)]
pub v: bool,
}
#[derive(StructOpt)]
pub enum TrunkSubcommands {
Build(build::Build),
Translate(translate::Translate),
Serve(serve::Serve),
Clean(clean::Clean),
Config(config::Config),
}