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
use std::path::PathBuf;
use clap::Args;
use treeboot_core::RunOptions;
use super::environment_input;
#[derive(Debug, Args, Clone, Default)]
pub(crate) struct RunArgs {
/// Override the checkout used as the file-operation source.
#[arg(short, long)]
root: Option<PathBuf>,
/// Use one specific config file and skip init script discovery.
#[arg(short, long)]
config: Option<PathBuf>,
/// Skip init script discovery and use declarative config discovery.
#[arg(long)]
no_init_script: bool,
/// Fail on missing config and stricter file-operation conflicts.
#[arg(short = 'S', long)]
strict: bool,
/// Replace existing file-operation targets where supported.
#[arg(short, long)]
force: bool,
/// Print planned work without changing files or running commands.
#[arg(short = 'n', long)]
dry_run: bool,
/// Print detailed file-operation actions.
#[arg(short, long)]
verbose: bool,
/// Run file operations only.
#[arg(long)]
skip_commands: bool,
}
impl From<RunArgs> for RunOptions {
fn from(args: RunArgs) -> Self {
Self {
cwd: None,
root: args.root,
environment: environment_input(),
config: args.config,
no_init_script: args.no_init_script,
strict: args.strict,
force: args.force,
dry_run: args.dry_run,
verbose: args.verbose,
skip_commands: args.skip_commands,
}
}
}