fix show help and replace version to specific

pull/104/head
xiagw 2020-09-17 18:15:40 +07:00
parent 34a7e1b761
commit 8ff7ecd5f3
No known key found for this signature in database
GPG Key ID: AA79D99901C34E05
1 changed files with 6 additions and 10 deletions

View File

@ -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