forked from Shinonome/dots-hyprland
Improve/Fix showhelp
This commit is contained in:
@@ -1,4 +1,29 @@
|
|||||||
# Handle args for subcmd: install
|
# 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(){
|
cleancache(){
|
||||||
rm -rf "$base/cache"
|
rm -rf "$base/cache"
|
||||||
}
|
}
|
||||||
@@ -15,7 +40,7 @@ para=$(getopt \
|
|||||||
eval set -- "$para"
|
eval set -- "$para"
|
||||||
while true ; do
|
while true ; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-h|--help) showhelp_global;exit;;
|
-h|--help) showhelp;exit;;
|
||||||
-c|--clean) cleancache;shift;;
|
-c|--clean) cleancache;shift;;
|
||||||
--) break ;;
|
--) break ;;
|
||||||
*) shift ;;
|
*) shift ;;
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ Options for install:
|
|||||||
--exp-files Use experimental script for the third step copying files
|
--exp-files Use experimental script for the third step copying files
|
||||||
--fontset <set> (Unavailable yet) Use a set of pre-defined font and config
|
--fontset <set> (Unavailable yet) Use a set of pre-defined font and config
|
||||||
--via-nix (Unavailable yet) Use Nix to install dependencies
|
--via-nix (Unavailable yet) Use Nix to install dependencies
|
||||||
--exp-uninstall Use experimental uninstall script
|
|
||||||
|
|
||||||
Subcommand:
|
Subcommand:
|
||||||
exp-uninstall Using experimental uninstall script.
|
exp-uninstall Using experimental uninstall script.
|
||||||
@@ -51,6 +50,10 @@ case $1 in
|
|||||||
SCRIPT_SUBCOMMAND=$1
|
SCRIPT_SUBCOMMAND=$1
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
# Global help
|
||||||
|
help|--help|-h)
|
||||||
|
showhelp_global;exit
|
||||||
|
;;
|
||||||
# no subcommand (has options: -* ; no options: "")
|
# no subcommand (has options: -* ; no options: "")
|
||||||
-*|"")
|
-*|"")
|
||||||
SCRIPT_SUBCOMMAND=install
|
SCRIPT_SUBCOMMAND=install
|
||||||
@@ -64,9 +67,6 @@ case ${SCRIPT_SUBCOMMAND} in
|
|||||||
install)
|
install)
|
||||||
source ./sdata/lib/options-install.sh
|
source ./sdata/lib/options-install.sh
|
||||||
;;
|
;;
|
||||||
exp-uninstall)
|
|
||||||
#source ./sdata/lib/options-exp-uninstall.sh
|
|
||||||
;;
|
|
||||||
exp-update)
|
exp-update)
|
||||||
source ./sdata/lib/options-exp-update.sh
|
source ./sdata/lib/options-exp-update.sh
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -564,7 +564,6 @@ if [[ "$SKIP_NOTICE" == false ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
exit
|
|
||||||
|
|
||||||
# Check if we're in a git repository
|
# Check if we're in a git repository
|
||||||
cd "$REPO_ROOT" || log_die "Failed to change to repository directory"
|
cd "$REPO_ROOT" || log_die "Failed to change to repository directory"
|
||||||
|
|||||||
Reference in New Issue
Block a user