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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
extern crate core;
#[macro_use]
extern crate indoc;
#[cfg(test)]
#[macro_use]
extern crate insta;
#[macro_use]
extern crate miette;
#[macro_use]
extern crate strum;
use itertools::Itertools;
use miette::{MietteHandlerOpts, Result};
use crate::cli::Cli;
#[cfg(test)]
#[macro_use]
mod test;
#[macro_use]
mod output;
#[macro_use]
mod regex;
#[macro_use]
mod cmd;
pub mod build_time;
mod cache;
mod cli;
mod config;
mod default_shorthands;
mod direnv;
mod dirs;
pub mod duration;
mod env;
mod env_diff;
mod errors;
mod fake_asdf;
mod file;
mod git;
pub mod github;
mod hash;
mod hook_env;
mod http;
mod install_context;
mod lock_file;
mod logger;
mod migrate;
mod path_env;
mod plugins;
mod rand;
mod runtime_symlinks;
mod shell;
mod shims;
mod shorthands;
mod task;
pub mod tera;
pub mod timeout;
mod toml;
mod toolset;
mod ui;
fn main() -> Result<()> {
let args = env::args().collect_vec();
// TODO: figure out how to display version/help
// let theme = GraphicalTheme::default();
// let handler = GraphicalReportHandler::new_themed(theme);
miette::set_hook(Box::new(|_| {
Box::new(MietteHandlerOpts::default().with_cause_chain().build())
}))?;
Cli::run(&args)
// match Cli::run(&args).with_context(|| miette!(help = format!("Version: {}", &*VERSION))) {
// Ok(()) => Ok(()),
// Err(err) => Err(err),
// Err(err) if log::max_level() < log::LevelFilter::Debug => {
// display_friendly_err(err);
// exit(1);
// }
// Err(err) => {
// Err(err).suggestion("Run with --verbose or MISE_VERBOSE=1 for more information.")
// }
}
// fn display_friendly_err(err: Report) {
// for err in err.chain() {
// error!("{err}");
// }
// let dim = |s| style(s).dim().for_stderr();
// error!(
// "{}",
// dim("Run with --verbose or MISE_VERBOSE=1 for more information")
// );
// }