summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrank LENORMAND <lenormf@gmail.com>2016-07-20 21:10:13 +0300
committerFrank LENORMAND <lenormf@gmail.com>2016-07-23 10:03:25 +0300
commit3c91f711fc5197fbcdb6712c92c44638d4ad2807 (patch)
tree1712f7a0419b766c33d1d9fbf855640e1ea79c8f /src
parent75589941498f492eb94f4b0c76209e0d4f2a608d (diff)
Warn the user when flag combinations don't make sense
Diffstat (limited to 'src')
-rw-r--r--src/main.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.cc b/src/main.cc
index 020c1e59..8e8ad9b4 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -779,7 +779,7 @@ int main(int argc, char* argv[])
if (auto session = parser.get_switch("p"))
{
- for (auto opt : { "c", "n", "s", "d", "e" })
+ for (auto opt : { "c", "n", "s", "d", "e", "ro" })
{
if (parser.get_switch(opt))
{
@@ -795,6 +795,12 @@ int main(int argc, char* argv[])
if (auto keys = parser.get_switch("f"))
{
+ if (parser.get_switch("ro"))
+ {
+ write_stderr("error: -ro makes not sense with -f\n");
+ return -1;
+ }
+
Vector<StringView> files;
for (size_t i = 0; i < parser.positional_count(); ++i)
files.emplace_back(parser[i]);
@@ -805,7 +811,7 @@ int main(int argc, char* argv[])
if (auto server_session = parser.get_switch("c"))
{
- for (auto opt : { "n", "s", "d" })
+ for (auto opt : { "n", "s", "d", "ro" })
{
if (parser.get_switch(opt))
{