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
use std::path::PathBuf;
use crate::config::settings::Settings;
use crate::toolset::tool_version::ResolveOptions;
#[derive(Debug, Clone)]
pub(crate) struct InstallOptions {
pub reason: String,
pub force: bool,
pub jobs: Option<usize>,
pub raw: bool,
/// only install missing tools if passed as arguments
pub missing_args_only: bool,
/// install lazy declarations because the user explicitly named a tool
pub include_lazy: bool,
/// completely disable auto-installation when auto_install setting is false
pub skip_auto_install: bool,
pub auto_install_disable_tools: Option<Vec<String>>,
pub resolve_options: ResolveOptions,
pub dry_run: bool,
/// Only run hooks defined in global config files.
pub global_hooks_only: bool,
/// require lockfile URLs to be present; fail if not
pub locked: bool,
/// Override the install directory (e.g. for --system or --shared)
pub install_dir: Option<PathBuf>,
/// Derive each tool's install directory from the scope of the config file that
/// declares it. Lazy first-use dispatch installs a provider together with its
/// dependencies, and those can come from different scopes.
pub scoped_install_dirs: bool,
/// skip confirmation prompts (e.g. installing missing plugin system deps).
/// Defaults to the global `yes` setting; `mise bootstrap --yes` also sets it.
pub yes: bool,
}
impl Default for InstallOptions {
fn default() -> Self {
InstallOptions {
jobs: Some(Settings::get().jobs),
raw: Settings::get().raw,
reason: "install".to_string(),
force: false,
missing_args_only: true,
include_lazy: false,
skip_auto_install: false,
auto_install_disable_tools: Settings::get().auto_install_disable_tools.clone(),
resolve_options: Default::default(),
dry_run: false,
global_hooks_only: false,
locked: Settings::get().locked,
install_dir: None,
scoped_install_dirs: false,
yes: Settings::get().yes,
}
}
}