clean_dev_dirs/config/execution.rs
1//! Execution configuration for cleanup operations.
2//!
3//! This module defines the options that control how cleanup operations are executed,
4//! including dry-run mode and interactive selection.
5
6/// Configuration for cleanup execution behavior.
7///
8/// This struct provides a simplified interface to execution-related options,
9/// controlling how the cleanup process runs.
10#[derive(Clone)]
11pub struct ExecutionOptions {
12 /// Whether to run in dry-run mode (no actual deletion)
13 pub dry_run: bool,
14
15 /// Whether to use interactive project selection
16 pub interactive: bool,
17
18 /// Whether to preserve compiled executables during cleanup
19 ///
20 /// When enabled, final executable binaries are preserved while
21 /// intermediate build artifacts are removed. This applies to:
22 /// - Rust: Preserves binaries in target/debug/ and target/release/
23 /// - Go: Preserves binaries in bin/ directory
24 pub keep_executables: bool,
25}
26
27#[cfg(test)]
28mod tests {
29 use super::*;
30
31 #[test]
32 fn test_execution_options_creation() {
33 let exec_opts = ExecutionOptions {
34 dry_run: true,
35 interactive: false,
36 keep_executables: true,
37 };
38
39 assert!(exec_opts.dry_run);
40 assert!(!exec_opts.interactive);
41 assert!(exec_opts.keep_executables);
42 }
43
44 #[test]
45 fn test_execution_options_clone() {
46 let original = ExecutionOptions {
47 dry_run: true,
48 interactive: false,
49 keep_executables: true,
50 };
51 let cloned = original.clone();
52
53 assert_eq!(original.dry_run, cloned.dry_run);
54 assert_eq!(original.interactive, cloned.interactive);
55 assert_eq!(original.keep_executables, cloned.keep_executables);
56 }
57}