-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathbluebuild.rs
More file actions
50 lines (46 loc) · 1.8 KB
/
Copy pathbluebuild.rs
File metadata and controls
50 lines (46 loc) · 1.8 KB
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
48
49
50
use blue_build::commands::{BlueBuildArgs, BlueBuildCommand, CommandArgs};
use blue_build_process_management::{logging::Logger, signal_handler};
use clap::Parser;
use log::LevelFilter;
fn main() {
let args = BlueBuildArgs::parse();
miette::set_hook(Box::new(|_| {
Box::new(
miette::MietteHandlerOpts::new()
.terminal_links(true)
.context_lines(3)
.tab_width(2)
.break_words(false)
.wrap_lines(false)
.with_cause_chain()
.build(),
)
}))
.expect("Should set hook for miette");
Logger::new()
.filter_level(args.verbosity.log_level_filter())
.filter_modules([
("hyper::proto", LevelFilter::Off),
("hyper_util", LevelFilter::Off),
("oci_distribution", LevelFilter::Off),
("reqwest", LevelFilter::Off),
("oci_client", LevelFilter::Off),
("rustls", LevelFilter::Off),
])
.log_out_dir(args.log_out.clone())
.init();
log::trace!("Parsed arguments: {args:#?}");
signal_handler::init(|| match args.command {
CommandArgs::Build(mut command) => command.run(),
CommandArgs::Generate(mut command) => command.run(),
CommandArgs::Switch(mut command) => command.run(),
CommandArgs::Login(mut command) => command.run(),
CommandArgs::New(mut command) => command.run(),
CommandArgs::Init(mut command) => command.run(),
CommandArgs::GenerateIso(mut command) => command.run(),
CommandArgs::Validate(mut command) => command.run(),
CommandArgs::Prune(mut command) => command.run(),
CommandArgs::BugReport(mut command) => command.run(),
CommandArgs::Completions(mut command) => command.run(),
});
}