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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//! # rskiller
//!
//! A Rust library for finding and cleaning Rust project build artifacts and caches.
//!
//! This library provides functionality to scan for Rust projects, analyze their
//! build artifacts, and safely clean up target directories and other cache files.
//!
//! ## Features
//!
//! - Find Rust projects by scanning for `Cargo.toml` files
//! - Analyze build artifacts and calculate sizes
//! - Safe cleanup with project activity detection
//! - Support for Cargo workspaces
//! - Configurable scanning and filtering options
//! - Configuration file support (TOML and JSON formats)
//!
//! ## Example
//!
//! ```rust
//! use rskiller::{ProjectScanner, Cli, SortBy, Color, ConfigFormat};
//! use std::path::PathBuf;
//!
//! #[tokio::main]
//! async fn main() -> anyhow::Result<()> {
//! let cli = Cli {
//! directory: Some(PathBuf::from("~/")),
//! full: false,
//! target: Some("target".to_string()),
//! sort: Some(SortBy::Size),
//! gb: false,
//! exclude: None,
//! exclude_hidden: false,
//! hide_errors: false,
//! delete_all: false,
//! dry_run: true,
//! list_only: true,
//! include_cargo_cache: false,
//! color: Some(Color::Blue),
//! no_check_update: false,
//! config: None,
//! print_config: false,
//! init_config: false,
//! format: ConfigFormat::Toml,
//! global: false,
//! validate_config: None,
//! config_info: false,
//! };
//!
//! let scanner = ProjectScanner::new(cli);
//! let projects = scanner.scan().await?;
//!
//! for project in &projects {
//! println!("Project: {} - Size: {} bytes",
//! project.name,
//! project.total_cleanable_size());
//! }
//!
//! Ok(())
//! }
//! ```
// Re-export main types and functions for easier access
pub use ;
pub use ;
pub use ProjectScanner;
pub use ;
pub use InteractiveUI;
pub use ;
/// Library version
pub const VERSION: &str = env!;
/// Default target directory name
pub const DEFAULT_TARGET: &str = "target";
/// Default search depth for project scanning
pub const DEFAULT_SEARCH_DEPTH: usize = 5;
/// Maximum search depth when scanning from home directory
pub const MAX_FULL_SEARCH_DEPTH: usize = 10;