From d76d411b35ea131c9817dc6250ab09009315db84 Mon Sep 17 00:00:00 2001 From: john30 Date: Thu, 1 Jan 2015 11:55:20 +0100 Subject: [PATCH] find reports anything by default --- src/ebusd/baseloop.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ebusd/baseloop.cpp b/src/ebusd/baseloop.cpp index 2043fe91..27bc2b84 100644 --- a/src/ebusd/baseloop.cpp +++ b/src/ebusd/baseloop.cpp @@ -394,32 +394,34 @@ string BaseLoop::decodeMessage(const string& data) break; } case ct_find: { - bool verbose = false, withRead = true, withWrite = false, withPassive = false, first = true, withData = false; + bool verbose = false, withRead = true, withWrite = true, withPassive = true, first = true, onlyWithData = false; string clazz; while (args.size() > argPos && args[argPos][0] == '-') { if (args[argPos] == "-v") verbose = true; else if (args[argPos] == "-r") { - if (first == true) + if (first == true) { first = false; + withWrite = withPassive = false; + } withRead = true; } else if (args[argPos] == "-w") { if (first == true) { first = false; - withRead = false; + withRead = withPassive = false; } withWrite = true; } else if (args[argPos] == "-p") { if (first == true) { first = false; - withRead = false; + withRead = withWrite = false; } withPassive = true; } else if (args[argPos] == "-d") { - withData = true; + onlyWithData = true; } else if (args[argPos] == "-c") { argPos++; @@ -454,7 +456,7 @@ string BaseLoop::decodeMessage(const string& data) if (dstAddress == SYN) continue; time_t lastup = message->getLastUpdateTime(); - if (withData == true && lastup == 0) + if (onlyWithData == true && lastup == 0) continue; if (found == true) result << endl;