-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmod.rs
More file actions
46 lines (36 loc) · 1011 Bytes
/
mod.rs
File metadata and controls
46 lines (36 loc) · 1011 Bytes
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
use std::path::PathBuf;
use clap::{Parser, Subcommand};
mod build;
mod completions;
mod image;
pub use build::*;
pub use completions::*;
pub use image::*;
#[derive(Debug, Parser)]
#[command(author, version, about)]
pub struct Cli {
/// Path to the configuration file.
#[arg(short, long = "configuration", global = true, default_value_os_t = Self::default_config_path())]
pub config_path: PathBuf,
#[command(subcommand)]
pub command: Command,
}
impl Cli {
fn default_config_path() -> PathBuf {
PathBuf::from("./boil.toml")
}
}
#[derive(Debug, Subcommand)]
pub enum Command {
/// Build one or more images.
///
/// Requires docker with the buildx extension.
#[command(alias = "some-chicken")]
Build(Box<BuildArguments>),
/// Display various structured outputs in JSON format.
Image(ImageArguments),
/// Alias for `image list`.
Images(ImageListArguments),
/// Generate shell completions.
Completions(CompletionsArguments),
}