a(){ local height=$1 local width=$2 local title=$3 local prompt=$4 shift 4 local options=("$@") local choices=$(whiptail --title "$title" --checklist
"$prompt" $height $width $(( ${#options[@]} + 5 ))
"${options[@]}"
3>&1 1>&2 2>&3) eval "$choices" }

示例用法

a 25 60 "选择插件" "请选择以下插件:"
"1" "锅巴插件" OFF
"2" "喵喵插件" OFF
"3" "文案插件" OFF
"4" "星穹铁道插件" OFF
"5" "土块插件" OFF

a $1=$whiptail --title $2 --checklist 请选择以下选项: 25 60 15 1 锅巴插件 OFF 2 喵喵插件 OFF 3 文案插件 OFF

原文地址: https://www.cveoy.top/t/topic/hnr6 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录