verify that 'got status -s' and 'got status -S' cannot be used together
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
diff --git a/regress/cmdline/status.sh b/regress/cmdline/status.sh
index 77a893c..47f3fb7 100755
--- a/regress/cmdline/status.sh
+++ b/regress/cmdline/status.sh
@@ -821,6 +821,44 @@ test_status_suppress() {
echo "new file" > $testroot/wt/new
(cd $testroot/wt && got add new >/dev/null)
+ (cd $testroot/wt && got status -S A -s M \
+ > $testroot/stdout 2> $testroot/stderr)
+ ret="$?"
+ if [ "$ret" = "0" ]; then
+ echo "status succeeded unexpectedly" >&2
+ test_done "$testroot" "1"
+ return 1
+ fi
+
+ echo "got: -s and -S options are mutually exclusive" \
+ > $testroot/stderr.expected
+ cmp -s $testroot/stderr.expected $testroot/stderr
+ ret="$?"
+ if [ "$ret" != "0" ]; then
+ diff -u $testroot/stderr.expected $testroot/stderr
+ test_done "$testroot" "$ret"
+ return 1
+ fi
+
+ (cd $testroot/wt && got status -s A -S M \
+ > $testroot/stdout 2> $testroot/stderr)
+ ret="$?"
+ if [ "$ret" = "0" ]; then
+ echo "status succeeded unexpectedly" >&2
+ test_done "$testroot" "1"
+ return 1
+ fi
+
+ echo "got: -S and -s options are mutually exclusive" \
+ > $testroot/stderr.expected
+ cmp -s $testroot/stderr.expected $testroot/stderr
+ ret="$?"
+ if [ "$ret" != "0" ]; then
+ diff -u $testroot/stderr.expected $testroot/stderr
+ test_done "$testroot" "$ret"
+ return 1
+ fi
+
(cd $testroot/wt && got status -S xDM \
> $testroot/stdout 2> $testroot/stderr)
ret="$?"