Skip to main content

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 before cleaning
19    pub keep_executables: bool,
20}
21
22#[cfg(test)]
23mod tests {
24    use super::*;
25
26    #[test]
27    fn test_execution_options_creation() {
28        let exec_opts = ExecutionOptions {
29            dry_run: true,
30            interactive: false,
31            keep_executables: false,
32        };
33
34        assert!(exec_opts.dry_run);
35        assert!(!exec_opts.interactive);
36        assert!(!exec_opts.keep_executables);
37    }
38
39    #[test]
40    fn test_execution_options_clone() {
41        let original = ExecutionOptions {
42            dry_run: true,
43            interactive: false,
44            keep_executables: true,
45        };
46        let cloned = original.clone();
47
48        assert_eq!(original.dry_run, cloned.dry_run);
49        assert_eq!(original.interactive, cloned.interactive);
50        assert_eq!(original.keep_executables, cloned.keep_executables);
51    }
52}