feat: add script catalog and -h help for all dotfile scripts

Introduce ff script -h with auto descriptions, shared help.sh, and usage flags across script/*.sh.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-25 15:09:35 +08:00
parent 1f6b042b26
commit 67291a9a50
36 changed files with 1056 additions and 442 deletions
+27
View File
@@ -1 +1,28 @@
#!/bin/bash
# 清理 Homebrew 缓存与无用文件
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck disable=SC1091
source "$SCRIPT_DIR/common/help.sh"
usage() {
cat <<'EOF'
用法: brew-clean
执行 Homebrew 清理(brew cleanup),删除旧版本与缓存。
选项:
-h, --help 显示此帮助
EOF
}
dotfile_help_requested "${1:-}" && dotfile_show_help
set -euo pipefail
if ! command -v brew &>/dev/null; then
echo "错误: 未找到 brew,请先安装 Homebrew" >&2
exit 1
fi
brew cleanup