refactor: 修改函数名称

This commit is contained in:
Olia Lisa
2026-07-15 23:17:09 +08:00
parent a3d4b752aa
commit 29ceedfe71
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -92,6 +92,6 @@ ask_update_port(){
local config_file="$script_dir/../conf/config.json" local config_file="$script_dir/../conf/config.json"
local current_port=$(jq -r '.inbounds[0].port' "$config_file") local current_port=$(jq -r '.inbounds[0].port' "$config_file")
local new_port=$(ask_update "请输入新的端口号" "$current_port") local new_port=$(ask_input "请输入新的端口号" "$current_port")
update_port "$new_port" update_port "$new_port"
} }
+3 -3
View File
@@ -77,10 +77,10 @@ check_config(){
} }
# 通用:展示当前值并询问新值 # 通用:展示当前值并询问新值
# 用法: ask_update "提示语" "当前值(当前配置文件的值)" # 用法: ask_input "提示语" "当前值(当前配置文件的值)"
# 示例: # 示例:
# new_port=$(ask_update "请输入新的端口号" "$(jq -r '.inbounds[0].port' $config_dir/config.json)") # new_port=$(ask_input "请输入新的端口号" "$(jq -r '.inbounds[0].port' $config_dir/config.json)")
ask_update() { ask_input() {
local prompt="$1" # 提示语 local prompt="$1" # 提示语
local current_value="$2" local current_value="$2"
local input local input