mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 20:19:45 +00:00
Delete useless help and optimize format
This commit is contained in:
3
.github/workflows/tests.yml
vendored
3
.github/workflows/tests.yml
vendored
@@ -16,5 +16,8 @@ jobs:
|
||||
- name: Install tools
|
||||
run: brew install bats-core shfmt shellcheck
|
||||
|
||||
- name: Format code
|
||||
run: ./scripts/format.sh
|
||||
|
||||
- name: Run all checks
|
||||
run: ./scripts/check.sh
|
||||
|
||||
@@ -2392,50 +2392,6 @@ export_to_json() {
|
||||
main() {
|
||||
local target_path="$HOME"
|
||||
|
||||
# Parse arguments - only support --help
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
-h | --help)
|
||||
echo "Usage: mole analyze"
|
||||
echo ""
|
||||
echo "Interactive disk space explorer - Navigate folders sorted by size"
|
||||
echo ""
|
||||
echo "Keyboard Controls:"
|
||||
echo " ${ICON_NAV_UP}/${ICON_NAV_DOWN} Navigate items"
|
||||
echo " Enter / ${ICON_NAV_RIGHT} Open selected folder"
|
||||
echo " ${ICON_NAV_LEFT} Go back to parent directory"
|
||||
echo " Delete Delete selected file/folder (requires confirmation)"
|
||||
echo " O Reveal current directory in Finder"
|
||||
echo " Q / ESC Quit the explorer"
|
||||
echo ""
|
||||
echo "Features:"
|
||||
echo " ${ICON_LIST} Files and folders sorted by size (largest first)"
|
||||
echo " ${ICON_LIST} Shows top 16 items per directory"
|
||||
echo " ${ICON_LIST} Fast parallel scanning with smart timeout"
|
||||
echo " ${ICON_LIST} Session cache for instant navigation"
|
||||
echo " ${ICON_LIST} Color coding for large folders (Red >10GB, Yellow >1GB)"
|
||||
echo " ${ICON_LIST} Safe deletion with confirmation"
|
||||
echo ""
|
||||
echo "Examples:"
|
||||
echo " mole analyze Start exploring from home directory"
|
||||
echo ""
|
||||
exit 0
|
||||
;;
|
||||
-*)
|
||||
echo "Error: Unknown option: $1" >&2
|
||||
echo "Usage: mole analyze" >&2
|
||||
echo "Use 'mole analyze --help' for more information" >&2
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
echo "Error: Paths are not supported in beta version" >&2
|
||||
echo "Usage: mole analyze" >&2
|
||||
echo "The explorer will start from your home directory" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
CURRENT_PATH="$target_path"
|
||||
|
||||
# Create cache directory
|
||||
|
||||
15
bin/clean.sh
15
bin/clean.sh
@@ -1412,7 +1412,7 @@ perform_cleanup() {
|
||||
}
|
||||
|
||||
main() {
|
||||
# Parse args (only dry-run and help for minimal impact)
|
||||
# Parse args (only dry-run and whitelist)
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
"--dry-run" | "-n")
|
||||
@@ -1423,19 +1423,6 @@ main() {
|
||||
manage_whitelist
|
||||
exit 0
|
||||
;;
|
||||
"--help" | "-h")
|
||||
echo "Mole - Deeper system cleanup"
|
||||
echo "Usage: clean.sh [options]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " --help, -h Show this help"
|
||||
echo " --dry-run, -n Preview what would be cleaned without deleting"
|
||||
echo " --whitelist Manage protected caches"
|
||||
echo ""
|
||||
echo "Interactive cleanup with smart password handling"
|
||||
echo ""
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
@@ -137,33 +137,6 @@ disable_touchid() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Show help
|
||||
show_help() {
|
||||
cat << EOF
|
||||
Usage: mo touchid [command]
|
||||
|
||||
Configure Touch ID for sudo to avoid repeated password prompts.
|
||||
|
||||
Commands:
|
||||
enable Enable Touch ID for sudo
|
||||
disable Disable Touch ID for sudo
|
||||
status Show current Touch ID configuration
|
||||
help Show this help message
|
||||
|
||||
Examples:
|
||||
mo touchid # Show status and options
|
||||
mo touchid enable # Enable Touch ID
|
||||
mo touchid status # Check current status
|
||||
|
||||
Notes:
|
||||
- Requires macOS with Touch ID sensor
|
||||
- Changes are applied to /etc/pam.d/sudo
|
||||
- Automatic backup is created before changes
|
||||
- You can restore from backup at ${PAM_SUDO_FILE}.mole-backup
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
# Interactive menu
|
||||
show_menu() {
|
||||
echo ""
|
||||
@@ -220,16 +193,11 @@ main() {
|
||||
status)
|
||||
show_status
|
||||
;;
|
||||
help | --help | -h)
|
||||
show_help
|
||||
;;
|
||||
"")
|
||||
show_menu
|
||||
;;
|
||||
*)
|
||||
log_error "Unknown command: $command"
|
||||
echo ""
|
||||
show_help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -21,40 +21,6 @@ source "$SCRIPT_DIR/../lib/batch_uninstall.sh"
|
||||
|
||||
# Note: Bundle preservation logic is now in lib/common.sh
|
||||
|
||||
# Help information
|
||||
show_help() {
|
||||
echo "Usage: mole uninstall"
|
||||
echo ""
|
||||
echo "Interactive application uninstaller - Remove apps completely"
|
||||
echo ""
|
||||
echo "Keyboard Controls:"
|
||||
echo " ${ICON_NAV_UP}/${ICON_NAV_DOWN} Navigate items"
|
||||
echo " Space Select/deselect"
|
||||
echo " Enter Confirm and uninstall"
|
||||
echo " Q / ESC Quit"
|
||||
echo ""
|
||||
echo "What gets cleaned:"
|
||||
echo " ${ICON_LIST} Application bundle"
|
||||
echo " ${ICON_LIST} Application Support data (12+ locations)"
|
||||
echo " ${ICON_LIST} Cache files"
|
||||
echo " ${ICON_LIST} Preference files"
|
||||
echo " ${ICON_LIST} Log files"
|
||||
echo " ${ICON_LIST} Saved application state"
|
||||
echo " ${ICON_LIST} Container data (sandboxed apps)"
|
||||
echo " ${ICON_LIST} WebKit storage, HTTP storage, cookies"
|
||||
echo " ${ICON_LIST} Extensions, plugins, services"
|
||||
echo ""
|
||||
echo "Examples:"
|
||||
echo " mole uninstall Launch interactive uninstaller"
|
||||
echo ""
|
||||
}
|
||||
|
||||
# Parse arguments
|
||||
if [[ "${1:-}" == "--help" || "${1:-}" == "-h" ]]; then
|
||||
show_help
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Initialize global variables
|
||||
selected_apps=() # Global array for app selection
|
||||
declare -a apps_data=()
|
||||
|
||||
@@ -356,7 +356,6 @@ paginated_multi_select() {
|
||||
|
||||
# Header only
|
||||
printf "${clear_line}${PURPLE}%s${NC} ${GRAY}%d/%d selected${NC}\n" "${title}" "$selected_count" "$total_items" >&2
|
||||
printf "${clear_line}\n" >&2
|
||||
|
||||
# Visible slice
|
||||
local visible_total=${#view_indices[@]}
|
||||
|
||||
Reference in New Issue
Block a user