1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-15 16:55:06 +00:00

chore: simplify dry run docs and change interactive shortcut to SPACE

This commit is contained in:
Tw93
2025-10-03 10:58:34 +08:00
parent ee98bd2e96
commit 5b60837b8b
2 changed files with 24 additions and 35 deletions

View File

@@ -118,36 +118,7 @@ $ mole analyze ~/Downloads
Items (sorted by size):
### Dry Run Preview
Before actually deleting, you can preview what would be removed:
```bash
mole clean --dry-run
```
In interactive menu: select Clean System and press `d` instead of Enter.
Sample output:
```bash
$ mole clean --dry-run
🧪 Dry Run mode: showing what would be removed (no deletions).
▶ System essentials
→ User app cache (45.2GB, dry)
→ User app logs (2.1GB, dry)
→ Trash (12.3GB, dry)
▶ Browser cleanup
→ Chrome cache (8.4GB, dry)
→ Safari cache (2.1GB, dry)
====================================================================
🧪 DRY RUN COMPLETE!
💾 Potential reclaimable space: 72.00GB (no changes made) | Free space now: 223.5GB
====================================================================
```
TYPE SIZE NAME
────────────────────────────────────────────────────────────────────────────────

30
mole
View File

@@ -268,7 +268,22 @@ interactive_main_menu() {
show_cursor
case $current_option in
1)
echo -e "${BLUE}Press 'd' for Dry Run preview, Enter to start cleaning (q to cancel)${NC}"
echo -e "${BLUE}Press SPACE for Dry Run preview, Enter to start cleaning (Esc/q to cancel)${NC}"
# SPACE => dry run; Enter => normal; Esc/q => cancel
IFS= read -r -s -n1 key2 || true
if [[ "$key2" == $'\e' ]]; then
# ESC pressed -> cancel
:
elif [[ "$key2" == ' ' ]]; then
exec "$SCRIPT_DIR/bin/clean.sh" --dry-run
elif [[ "$key2" == $'\n' || -z "$key2" ]]; then
exec "$SCRIPT_DIR/bin/clean.sh"
elif [[ "$key2" == 'q' || "$key2" == 'Q' ]]; then
:
else
exec "$SCRIPT_DIR/bin/clean.sh"
fi
continue
IFS= read -r -s -n1 key2 || true
if [[ "$key2" == $'\n' || -z "$key2" ]]; then
exec "$SCRIPT_DIR/bin/clean.sh"
@@ -291,13 +306,16 @@ interactive_main_menu() {
show_cursor
case $key in
1)
echo -e "${BLUE}Press 'd' for Dry Run preview, Enter to start cleaning (q to cancel)${NC}"
echo -e "${BLUE}Press SPACE for Dry Run preview, Enter to start cleaning (Esc/q to cancel)${NC}"
# SPACE => dry run; Enter => normal; Esc/q => cancel
IFS= read -r -s -n1 key2 || true
if [[ "$key2" == $'\n' || -z "$key2" ]]; then
exec "$SCRIPT_DIR/bin/clean.sh"
elif [[ "$key2" == "d" || "$key2" == "D" ]]; then
if [[ "$key2" == $'\e' ]]; then
:
elif [[ "$key2" == ' ' ]]; then
exec "$SCRIPT_DIR/bin/clean.sh" --dry-run
elif [[ "$key2" == "q" || "$key2" == "Q" ]]; then
elif [[ "$key2" == $'\n' || -z "$key2" ]]; then
exec "$SCRIPT_DIR/bin/clean.sh"
elif [[ "$key2" == 'q' || "$key2" == 'Q' ]]; then
:
else
exec "$SCRIPT_DIR/bin/clean.sh"