From 8ff7ecd5f36bb3a5db6c766fe6c474d71cfcf745 Mon Sep 17 00:00:00 2001 From: xiagw Date: Thu, 17 Sep 2020 18:15:40 +0700 Subject: [PATCH] fix show help and replace version to specific --- install-release.sh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/install-release.sh b/install-release.sh index 7b8daf1..1ae9165 100644 --- a/install-release.sh +++ b/install-release.sh @@ -115,7 +115,7 @@ judgment_parameters() { REMOVE='1' break ## 跳出while ;; - '--version') + '--specific') VERSION="${2:?error: Please specify the correct version.}" break ##跳出while ;; @@ -127,10 +127,6 @@ judgment_parameters() { FORCE='1' break ##跳出while ;; - '-h' | '--help') - HELP='1' - break ##跳出while - ;; '-l' | '--local') LOCAL_INSTALL='1' LOCAL_FILE="${2:?error: Please specify the correct local file.}" @@ -145,7 +141,7 @@ judgment_parameters() { shift ## 参数左移 ;; *) - echo "$0: unknown option '$*'" + show_help exit 1 ;; esac @@ -406,10 +402,10 @@ remove_v2ray() { # Explanation of parameters in the script show_help() { - echo "usage: $0 [--remove | --version number | -c | -f | -h | -l | -p]" - echo ' [-p address] [--version number | -c | -f]' + echo "usage: $0 [--remove | --specific number | -c | -f | -h | -l | -p]" + echo ' [-p address] [--specific number | -c | -f]' echo ' --remove Remove V2Ray' - echo ' --version Install the specified version of V2Ray, e.g., --version v4.18.0' + echo ' --specific Install the specified version of V2Ray, e.g., --specific v4.18.0' echo ' -c, --check Check if V2Ray can be updated' echo ' -f, --force Force installation of the latest version of V2Ray' echo ' -h, --help Show help' @@ -424,7 +420,7 @@ main() { judgment_parameters "$@" # Parameter information - [[ "$HELP" -eq '1' ]] && show_help + # [[ "$HELP" -eq '1' ]] && show_help [[ "$CHECK" -eq '1' ]] && check_update [[ "$REMOVE" -eq '1' ]] && remove_v2ray