make command line args mutually exclusive

This commit is contained in:
Vlasta Vesely 2020-01-04 08:59:43 +01:00
parent 4e82a7343d
commit dba90f5c15
No known key found for this signature in database
GPG key ID: EB0E649DC0DFCC22

5
main.c
View file

@ -134,6 +134,11 @@ int main(int argc, const char **argv)
}
}
if (flags != FLAG_REVERSE && flags != FLAG_CZECH && flags != FLAG_ENCODE) {
error("options '-r', '-e' and '-c' are mutually exclusive.");
return -1;
}
if (flags & FLAG_STDIN) {
input = stdin_read();
if (input == NULL) {