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
//! # Purger
//!
//! A tool for cleaning Rust project build directories.
//!
//! This crate provides both command-line and GUI interfaces for scanning
//! and cleaning Rust project target directories to free up disk space.
//!
//! ## Features
//!
//! - Scan directories for Rust projects
//! - Clean target directories using `cargo clean` or direct deletion
//! - Progress tracking for cleaning operations
//! - Both CLI and GUI interfaces
//!
//! ## Usage
//!
//! ### Command Line
//!
//! ```bash
//! # Scan current directory
//! purger scan
//!
//! # Clean all projects in current directory
//! purger clean --all
//!
//! # Dry run to see what would be cleaned
//! purger clean --dry-run
//! ```
//!
//! ### As a Library
//!
//! ```rust
//! use purger_core::{ProjectScanner, ProjectCleaner, scanner::ScanConfig, cleaner::CleanConfig};
//! use std::path::Path;
//!
//! // Scan for projects
//! let scanner = ProjectScanner::new(ScanConfig::default());
//! let projects = scanner.scan(Path::new("."))?;
//!
//! // Clean projects (using dry_run to avoid actual deletion)
//! let mut clean_config = CleanConfig::default();
//! clean_config.dry_run = true; // Use dry run to avoid permission issues
//! let cleaner = ProjectCleaner::new(clean_config);
//! for project in &projects {
//! let _ = cleaner.clean_project(project); // Ignore result in doc test
//! }
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
// Re-export core functionality
pub use *;
// Re-export commonly used types
pub use ;