mirror of
https://github.com/espressif/openthread.git
synced 2026-10-19 05:58:16 +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 "$@"
|
envsetup "$@"
|
||||||
|
|
||||||
if [[ -z $1 ]]; then
|
if [[ -z ${1:-} ]]; then
|
||||||
print_usage 1
|
print_usage 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -469,6 +469,10 @@ main()
|
|||||||
shift
|
shift
|
||||||
do_untar "$@"
|
do_untar "$@"
|
||||||
;;
|
;;
|
||||||
|
*)
|
||||||
|
echo
|
||||||
|
echo -e "${COLOR_FAIL}Warning:${COLOR_NONE} Ignoring: '$1'"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user