vibe-core/tests/args.sh
2017-02-17 00:55:16 +01:00

11 lines
338 B
Bash
Executable file

#!/bin/bash
set -e
die() { echo "$@" 1>&2 ; exit 1; }
( dub args.d | grep -q '^argtest=$' ) || die "Fail (no argument)"
( dub args.d --argtest=aoeu | grep -q '^argtest=aoeu$' ) || die "Fail (with argument)"
( ( ! dub args.d --inexisting 2>&1 ) | grep -qF 'Unrecognized command line option' ) || die "Fail (unknown argument)"
echo 'OK'