From 2014a030d6f55d056ab5d44b47e3156dddbba4ce Mon Sep 17 00:00:00 2001 From: clsty Date: Sun, 19 Oct 2025 11:22:24 +0800 Subject: [PATCH] Deprecate install.sh in favor of setup Still decide to deprecate install.sh cuz TAB completion can not be done without intrusive and automatic method, so just use ./setup instead. --- install.sh | 14 +++++--------- sdata/lib/functions.sh | 17 ----------------- setup | 24 +++++++++++++++++++++--- 3 files changed, 26 insertions(+), 29 deletions(-) diff --git a/install.sh b/install.sh index c24f3c24b..7186dd32f 100755 --- a/install.sh +++ b/install.sh @@ -1,14 +1,10 @@ #!/usr/bin/env bash -# TODO: Handle TAB completion for ./setup with non-intrusive method, -# or other shortcut helper like TUI. -# After that, remove this script (install.sh). - - -#STY_RED='\e[31m' -#STY_RST='\e[00m' -#printf "${STY_RED}You are using \"./install.sh\" which is kept for compatibility and will be removed in future.\n" -#printf "Please use \"./setup install\" instead.${STY_RST}\n" +# Remove this script (install.sh) after 2025.12.01 +STY_RED='\e[31m' +STY_RST='\e[00m' +printf "${STY_RED}You are using \"./install.sh\" which is kept for compatibility and will be removed in future.\n" +printf "Please use \"./setup install\" instead.${STY_RST}\n" cd "$(dirname "$0")" ./setup install "$@" diff --git a/sdata/lib/functions.sh b/sdata/lib/functions.sh index c1aa6504e..496397f83 100644 --- a/sdata/lib/functions.sh +++ b/sdata/lib/functions.sh @@ -287,20 +287,3 @@ function check_disk_space() { return 0 } - -function showhelp_global(){ -echo -e " - -Syntax: - $0 [OPTIONS]... - -Subcommands: - install Idempotent installation for dotfiles. - exp-uninstall Experimental uninstall - exp-update Experimental update - help Show this help message - -Please run the following for details: - $0 -h -" -} diff --git a/setup b/setup index 746e537a2..7feb9713e 100755 --- a/setup +++ b/setup @@ -10,13 +10,31 @@ prevent_sudo_or_root set -e ##################################################################################### +function showhelp_global(){ +printf "[$0]: Handle setup for illogical-impulse. + +Syntax: + $0 [OPTIONS]... + +Subcommands: + install (Default) Install or update illogical-impulse. + exp-uninstall (Experimental) Uninstall illogical-impulse. + exp-update (Experimental) Update illogical-impulse without fully install. + help Show this help message + +Please run the following for details: + $0 -h +" +} case $1 in # Global help - ""|help|--help|-h) showhelp_global;exit;; + help|--help|-h)showhelp_global;exit;; # Correct subcommand - install|exp-uninstall|exp-update) SCRIPT_SUBCOMMAND=$1;shift;; + install|exp-uninstall|exp-update)SCRIPT_SUBCOMMAND=$1;shift;; + # No subcommand + -*|"")SCRIPT_SUBCOMMAND=install;; # Wrong subcommand - *)echo "Unknown subcommand \"$1\", aborting...";exit 1;; + *)printf "${STY_RED}Unknown subcommand \"$1\".${STY_RST}\n";showhelp_global;exit 1;; esac ##################################################################################### case ${SCRIPT_SUBCOMMAND} in