From be1659b1bf99da52e56d2bdf6f26e3b4c0094012 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sun, 17 May 2020 12:06:39 +0200 Subject: [PATCH] pm3: textual and --list with no device, exit 1 --- pm3 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pm3 b/pm3 index ddcaa14ee..c9c616352 100755 --- a/pm3 +++ b/pm3 @@ -338,7 +338,7 @@ done if [ "$1" == "--list" ]; then shift if [ "$1" != "" ]; then - echo "Option --list must be used alone" + echo "[!!] Option --list must be used alone" exit 1 fi SHOWLIST=true @@ -352,7 +352,7 @@ if [ "$1" == "-n" ]; then N=$1 shift else - echo "Option -n requires a number between 1 and 9, got \"$1\"" + echo "[!!] Option -n requires a number between 1 and 9, got \"$1\"" exit 1 fi fi @@ -363,7 +363,7 @@ if [ "$HOSTOS" = "LINUX" ]; then # Test presence of wmic wmic.exe computersystem get name >/dev/null 2>&1 if [ $? -ne 0 ]; then - echo "[!] Cannot run wmic.exe, are you sure your WSL is authorized to run Windows processes? (cf WSL interop flag)" + echo "[!!] Cannot run wmic.exe, are you sure your WSL is authorized to run Windows processes? (cf WSL interop flag)" exit 1 fi GETPM3LIST=get_pm3_list_WSL @@ -384,7 +384,7 @@ if $SHOWLIST; then $GETPM3LIST 9 if [ ${#PM3LIST} -lt 1 ]; then echo "[!!] No port found" - exit 0 + exit 1 fi n=1 for DEV in ${PM3LIST[@]}