From d79594aa3f268d29c6963ac8da247e12ee234029 Mon Sep 17 00:00:00 2001 From: Muminul Islam Date: Wed, 2 Dec 2020 12:46:02 -0800 Subject: [PATCH] scripts: dev_cli: Remove unnecessary spaces Signed-off-by: Muminul Islam --- scripts/dev_cli.sh | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/scripts/dev_cli.sh b/scripts/dev_cli.sh index 0931c3a71..5e63c909b 100755 --- a/scripts/dev_cli.sh +++ b/scripts/dev_cli.sh @@ -212,9 +212,9 @@ cmd_build() { while [ $# -gt 0 ]; do case "$1" in - "-h"|"--help") { cmd_help; exit 1; } ;; - "--debug") { build="debug"; } ;; - "--release") { build="release"; } ;; + "-h"|"--help") { cmd_help; exit 1; } ;; + "--debug") { build="debug"; } ;; + "--release") { build="release"; } ;; "--libc") shift [[ "$1" =~ ^(musl|gnu)$ ]] || \ @@ -229,7 +229,7 @@ cmd_build() { shift hypervisor="$1" ;; - "--") { shift; break; } ;; + "--") { shift; break; } ;; *) die "Unknown build argument: $1. Please use --help for help." ;; @@ -290,15 +290,14 @@ cmd_tests() { libc="gnu" arg_vols="" hypervisor="kvm" - saved_args=("$@") while [ $# -gt 0 ]; do case "$1" in - "-h"|"--help") { cmd_help; exit 1; } ;; - "--unit") { unit=true; } ;; - "--cargo") { cargo=true; } ;; - "--integration") { integration=true; } ;; - "--integration-sgx") { integration_sgx=true; } ;; - "--integration-windows") { integration_windows=true; } ;; + "-h"|"--help") { cmd_help; exit 1; } ;; + "--unit") { unit=true; } ;; + "--cargo") { cargo=true; } ;; + "--integration") { integration=true; } ;; + "--integration-sgx") { integration_sgx=true; } ;; + "--integration-windows") { integration_windows=true; } ;; "--libc") shift [[ "$1" =~ ^(musl|gnu)$ ]] || \ @@ -313,8 +312,8 @@ cmd_tests() { shift hypervisor="$1" ;; - "--all") { cargo=true; unit=true; integration=true; } ;; - "--") { shift; break; } ;; + "--all") { cargo=true; unit=true; integration=true; } ;; + "--") { shift; break; } ;; *) die "Unknown tests argument: $1. Please use --help for help." ;; @@ -324,6 +323,8 @@ cmd_tests() { if [[ "$hypervisor" != "kvm" ]]; then die "Hypervisor value must be kvm" fi + set -- "$@" '--hypervisor' $hypervisor + process_volumes_args target="$(uname -m)-unknown-linux-${libc}" cflags="" @@ -346,7 +347,7 @@ cmd_tests() { --env CFLAGS="$cflags" \ --env TARGET_CC="$target_cc" \ "$CTR_IMAGE" \ - ./scripts/run_unit_tests.sh "${saved_args[@]}" || fix_dir_perms $? || exit $? + ./scripts/run_unit_tests.sh "$@" || fix_dir_perms $? || exit $? fi if [ "$cargo" = true ] ; then @@ -356,7 +357,7 @@ cmd_tests() { --rm \ --volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" $exported_volumes \ "$CTR_IMAGE" \ - ./scripts/run_cargo_tests.sh "${saved_args[@]}" || fix_dir_perms $? || exit $? + ./scripts/run_cargo_tests.sh "$@" || fix_dir_perms $? || exit $? fi if [ "$integration" = true ] ; then @@ -375,7 +376,7 @@ cmd_tests() { --env USER="root" \ --env CH_LIBC="${libc}" \ "$CTR_IMAGE" \ - ./scripts/run_integration_tests_$(uname -m).sh "${saved_args[@]}" || fix_dir_perms $? || exit $? + ./scripts/run_integration_tests_$(uname -m).sh "$@" || fix_dir_perms $? || exit $? fi if [ "$integration_sgx" = true ] ; then @@ -394,7 +395,7 @@ cmd_tests() { --env USER="root" \ --env CH_LIBC="${libc}" \ "$CTR_IMAGE" \ - ./scripts/run_integration_tests_sgx.sh "${saved_args[@]}" || fix_dir_perms $? || exit $? + ./scripts/run_integration_tests_sgx.sh "$@" || fix_dir_perms $? || exit $? fi if [ "$integration_windows" = true ] ; then @@ -413,7 +414,7 @@ cmd_tests() { --env USER="root" \ --env CH_LIBC="${libc}" \ "$CTR_IMAGE" \ - ./scripts/run_integration_tests_windows.sh "${saved_args[@]}" || fix_dir_perms $? || exit $? + ./scripts/run_integration_tests_windows.sh "$@" || fix_dir_perms $? || exit $? fi fix_dir_perms $? } @@ -423,9 +424,9 @@ cmd_build-container() { while [ $# -gt 0 ]; do case "$1" in - "-h"|"--help") { cmd_help; exit 1; } ;; + "-h"|"--help") { cmd_help; exit 1; } ;; "--dev") { container_type="dev"; } ;; - "--") { shift; break; } ;; + "--") { shift; break; } ;; *) die "Unknown build-container argument: $1. Please use --help for help." ;; @@ -475,8 +476,8 @@ cmd_shell() { # while [ $# -gt 0 ]; do case "$1" in - -h|--help) { cmd_help; exit 1; } ;; - -y|--unattended) { OPT_UNATTENDED=true; } ;; + -h|--help) { cmd_help; exit 1; } ;; + -y|--unattended) { OPT_UNATTENDED=true; } ;; -*) die "Unknown arg: $1. Please use \`$0 help\` for help." ;;