make got status -s and -S options conflict
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
diff --git a/got/got.1 b/got/got.1
index c36aa31..8b3c89a 100644
--- a/got/got.1
+++ b/got/got.1
@@ -711,6 +711,9 @@ argument.
Any combination of codes from the above list of possible status codes
may be specified.
For staged files, status codes displayed in either column will be matched.
+Cannot be used together with the
+.Fl S
+option.
.It Fl S Ar status-codes
Suppress the output of files with a modification status matching any of the
single-character status codes contained in the
@@ -719,6 +722,9 @@ argument.
Any combination of codes from the above list of possible status codes
may be specified.
For staged files, status codes displayed in either column will be matched.
+Cannot be used together with the
+.Fl s
+option.
.El
.Pp
For compatibility with
diff --git a/got/got.c b/got/got.c
index 54b0e26..66d66fa 100644
--- a/got/got.c
+++ b/got/got.c
@@ -5341,9 +5341,13 @@ cmd_status(int argc, char *argv[])
optarg[i]);
}
}
+ if (st.suppress)
+ option_conflict('s', 'S');
st.status_codes = optarg;
break;
case 'S':
+ if (st.status_codes != NULL && st.suppress == 0)
+ option_conflict('S', 's');
st.status_codes = optarg;
st.suppress = 1;
break;