diff --git a/test/sharness/t0010-basic-commands.sh b/test/sharness/t0010-basic-commands.sh index 63c482aba..e9db0c6c1 100755 --- a/test/sharness/t0010-basic-commands.sh +++ b/test/sharness/t0010-basic-commands.sh @@ -66,7 +66,7 @@ test_expect_success "All commands accept --help" ' while read -r cmd do $cmd --help /dev/null || - { echo $cmd doesnt accept --help; echo 1 > fail; } + { echo "$cmd doesnt accept --help"; echo 1 > fail; } done /dev/null || - { echo missing $cmd from helptext; echo 1 > fail; } + { echo "missing $cmd from helptext"; echo 1 > fail; } done if [ $(cat fail) = 1 ]; then @@ -94,7 +94,20 @@ test_expect_failure "All ipfs commands docs are 80 columns or less" ' do LENGTH="$($cmd --help | awk "{ print length }" | sort -nr | head -1)" [ $LENGTH -gt 80 ] && - { echo "$cmd" help text is longer than 79 chars "($LENGTH)"; echo 1 > fail; } + { echo "$cmd help text is longer than 79 chars ($LENGTH)"; echo 1 > fail; } + done fail + while read -r cmd + do + test_must_fail $cmd --badflag >/dev/null || + { echo "$cmd exit with code 0 when passed --badflag"; echo 1 > fail; } done