Improve/Fix showhelp

This commit is contained in:
clsty
2025-10-18 01:24:26 +08:00
parent 7c21ec0c5a
commit 0ccdc47034
3 changed files with 30 additions and 6 deletions
+26 -1
View File
@@ -1,4 +1,29 @@
# Handle args for subcmd: install
showhelp(){
echo -e "Syntax: $0 [OPTIONS]...
Idempotent installation script for dotfiles.
Options for install:
-h, --help Print this help message and exit
-f, --force (Dangerous) Force mode without any confirm
-c, --clean Clean the build cache first
--skip-allgreeting Skip the whole process greeting
--skip-alldeps Skip the whole process installing dependency
--skip-allsetups Skip the whole process setting up permissions/services etc
--skip-allfiles Skip the whole process copying configuration files
-s, --skip-sysupdate Skip system package upgrade e.g. \"sudo pacman -Syu\"
--skip-hyprland Skip installing the config for Hyprland
--skip-fish Skip installing the config for Fish
--skip-plasmaintg Skip installing plasma-browser-integration
--skip-miscconf Skip copying the dirs and files to \".configs\" except for
AGS, Fish and Hyprland
--exp-files Use experimental script for the third step copying files
--fontset <set> (Unavailable yet) Use a set of pre-defined font and config
--via-nix (Unavailable yet) Use Nix to install dependencies
"
}
cleancache(){
rm -rf "$base/cache"
}
@@ -15,7 +40,7 @@ para=$(getopt \
eval set -- "$para"
while true ; do
case "$1" in
-h|--help) showhelp_global;exit;;
-h|--help) showhelp;exit;;
-c|--clean) cleancache;shift;;
--) break ;;
*) shift ;;
+4 -4
View File
@@ -28,7 +28,6 @@ Options for install:
--exp-files Use experimental script for the third step copying files
--fontset <set> (Unavailable yet) Use a set of pre-defined font and config
--via-nix (Unavailable yet) Use Nix to install dependencies
--exp-uninstall Use experimental uninstall script
Subcommand:
exp-uninstall Using experimental uninstall script.
@@ -51,6 +50,10 @@ case $1 in
SCRIPT_SUBCOMMAND=$1
shift
;;
# Global help
help|--help|-h)
showhelp_global;exit
;;
# no subcommand (has options: -* ; no options: "")
-*|"")
SCRIPT_SUBCOMMAND=install
@@ -64,9 +67,6 @@ case ${SCRIPT_SUBCOMMAND} in
install)
source ./sdata/lib/options-install.sh
;;
exp-uninstall)
#source ./sdata/lib/options-exp-uninstall.sh
;;
exp-update)
source ./sdata/lib/options-exp-update.sh
;;
-1
View File
@@ -564,7 +564,6 @@ if [[ "$SKIP_NOTICE" == false ]]; then
exit 1
fi
fi
exit
# Check if we're in a git repository
cd "$REPO_ROOT" || log_die "Failed to change to repository directory"