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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
use clap::Parser;
use std::path::PathBuf;
#[derive(Parser, Debug, Clone)]
#[command(
name = "rusdu",
version,
about = "Rust rewrite of ncdu — NCurses Disk Usage analyzer"
)]
pub struct Args {
/// Directory or file to scan
pub path: Option<PathBuf>,
/// Load the given file earlier created with -o or -O
#[arg(short = 'f', long = "import")]
pub import_file: Option<PathBuf>,
/// Export directory tree in JSON format to file
#[arg(short = 'o', long = "export-json")]
pub export_json: Option<PathBuf>,
/// Export directory tree in binary format to file
#[arg(short = 'O', long = "export-bin")]
pub export_bin: Option<PathBuf>,
/// Enable extended information mode (read uid, gid, mode, mtime)
#[arg(short = 'e', long = "extended")]
pub extended: bool,
/// Do not attempt to load any configuration files
#[arg(long = "ignore-config")]
pub ignore_config: bool,
/// Do not cross filesystem boundaries
#[arg(short = 'x', long = "one-file-system")]
pub one_file_system: bool,
/// Exclude files that match pattern
#[arg(long = "exclude", value_name = "PATTERN")]
pub exclude: Vec<String>,
/// Exclude files that match any pattern in file
#[arg(short = 'X', long = "exclude-from", value_name = "FILE")]
pub exclude_from: Option<PathBuf>,
/// Exclude directories containing CACHEDIR.TAG
#[arg(long = "exclude-caches")]
pub exclude_caches: bool,
/// Exclude Linux pseudo filesystems (e.g. /proc, /sys)
#[arg(long = "exclude-kernfs")]
pub exclude_kernfs: bool,
/// Follow symlinks and count the size of the file they point to
#[arg(short = 'L', long = "follow-symlinks")]
pub follow_symlinks: bool,
/// Number of threads to use when scanning the filesystem
#[arg(short = 't', long = "threads")]
pub threads: Option<usize>,
/// Enable Zstandard compression when exporting to JSON (-o)
#[arg(short = 'c', long = "compress")]
pub compress: bool,
/// Set the Zstandard compression level when using -O or -c (1-19)
#[arg(long = "compress-level")]
pub compress_level: Option<i32>,
/// Set block size in KiB for binary export format (-O)
#[arg(long = "export-block-size")]
pub export_block_size: Option<usize>,
/// Don't give any feedback while scanning a directory (silent mode)
#[arg(short = '0', long = "silent")]
pub silent: bool,
/// Write progress information to the terminal (line mode)
#[arg(short = '1', long = "line-progress")]
pub line_progress: bool,
/// Show full-screen TUI interface while scanning (default)
#[arg(short = '2', long = "fullscreen-progress")]
pub fullscreen_progress: bool,
/// Slow down TUI updates (update every 2 seconds instead of 10 times a second)
#[arg(short = 'q', long = "slow-ui-updates")]
pub slow_updates: bool,
/// Read-only mode: -r disables deletion, -rr disables deletion and shell spawning
#[arg(short = 'r', action = clap::ArgAction::Count)]
pub read_only: u8,
/// Use base 10 prefixes (SI units) instead of base 2
#[arg(long = "si")]
pub si: bool,
/// Show apparent size instead of disk usage
#[arg(long = "apparent-size")]
pub apparent_size: bool,
/// Show hidden and excluded files
#[arg(long = "show-hidden")]
pub show_hidden: bool,
/// Show item counts column
#[arg(long = "show-itemcount")]
pub show_itemcount: bool,
/// Show last modification time column (requires -e)
#[arg(long = "show-mtime")]
pub show_mtime: bool,
/// Show relative size bar column
#[arg(long = "show-graph")]
pub show_graph: bool,
/// Show relative size percent column
#[arg(long = "show-percent")]
pub show_percent: bool,
/// Graph style: hash, half-block, eighth-block
#[arg(long = "graph-style", default_value = "hash")]
pub graph_style: String,
/// Shared column mode: off, shared, unique
#[arg(long = "shared-column", default_value = "shared")]
pub shared_column: String,
/// Change the default column to sort on: disk-usage, name, apparent-size, itemcount, mtime
#[arg(long = "sort", default_value = "disk-usage")]
pub sort: String,
/// Enable natural sort when sorting by file name
#[arg(long = "enable-natsort")]
pub enable_natsort: bool,
/// Sort directories before files
#[arg(long = "group-directories-first")]
pub group_directories_first: bool,
/// Require confirmation before quitting
#[arg(long = "confirm-quit")]
pub confirm_quit: bool,
/// Require confirmation before deleting a file/directory
#[arg(long = "confirm-delete")]
pub confirm_delete: bool,
/// Replace built-in deletion with custom shell command
#[arg(long = "delete-command", value_name = "CMD")]
pub delete_command: Option<String>,
/// Set color scheme: off, dark, dark-bg
#[arg(long = "color", default_value = "off")]
pub color: String,
/// Enable Nerd Font icons in TUI list
#[arg(long = "icons")]
pub icons: bool,
/// Log errors and scanning diagnostics to a file
#[arg(long = "log-file", value_name = "FILE")]
pub log_file: Option<PathBuf>,
}