diff --git a/test/help.sh b/test/help.sh new file mode 100755 index 0000000..40a1324 --- /dev/null +++ b/test/help.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +. $(dirname "${BASH_SOURCE[0]}")/common.sh + +DUB=dub + +### It shows the general help message +if ! { ${DUB} help | grep "Manages the DUB project in the current directory."; } then + die 'DUB did not print the default help message, with the `help` command.' +fi + +if ! { ${DUB} -h | grep "Manages the DUB project in the current directory."; } then + die 'DUB did not print the default help message, with the `-h` argument.' +fi + +if ! { ${DUB} --help | grep "Manages the DUB project in the current directory."; } then + die 'DUB did not print the default help message, with the `--help` argument.' +fi + +### It shows the build command help +if ! { ${DUB} build -h | grep "Builds a package"; } then + die 'DUB did not print the build help message, with the `-h` argument.' +fi + +if ! { ${DUB} build -h | grep "Builds a package"; } then + die 'DUB did not print the build help message, with the `--help` argument.' +fi