mirror of
https://github.com/espressif/openthread.git
synced 2026-09-11 11:40:06 +00:00
[script] fix output when no arguments are specified (#5551)
When no arguments are provided to script/test, the script prints $1: unbound variable and exits without printing the usage information. This is due to the set -u at the top. This commit has a small fix so that this usage is presented with the usage information. Also, it prints an error when it detect an unknown command.
This commit is contained in:
+5
-1
@@ -423,7 +423,7 @@ main()
|
||||
{
|
||||
envsetup "$@"
|
||||
|
||||
if [[ -z $1 ]]; then
|
||||
if [[ -z ${1:-} ]]; then
|
||||
print_usage 1
|
||||
fi
|
||||
|
||||
@@ -469,6 +469,10 @@ main()
|
||||
shift
|
||||
do_untar "$@"
|
||||
;;
|
||||
*)
|
||||
echo
|
||||
echo -e "${COLOR_FAIL}Warning:${COLOR_NONE} Ignoring: '$1'"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user