Closed chendelin1982 closed 9 months ago
# 获取参数值
while [[ $# -gt 0 ]]; do
case $1 in
--version)
shift
if [[ $1 == --* ]]; then
echo "Missing value for --version"
exit 1
fi
version="$1"
shift
;;
--port)
shift
if [[ $1 == --* ]]; then
echo "Missing value for --port"
exit 1
fi
port="$1"
shift
;;
--channel)
shift
if [[ $1 == --* ]]; then
echo "Missing value for --channel"
exit 1
fi
channel="$1"
shift
;;
--path)
shift
if [[ $1 == --* ]]; then
echo "Missing value for --path"
exit 1
fi
path="$1"
shift
;;
--devto)
shift
if [[ $1 == --* ]]; then
echo "Missing value for --devto"
exit 1
fi
devto="$1"
shift
;;
*)
echo "Unknown parameter: $1"
exit 1
;;
esac
done
Describe the bug
all parameter, e.g --port --channel... if have not includes value, the script will handler
related script