diff options
Diffstat (limited to 'src/bmclient/main.cpp')
-rw-r--r-- | src/bmclient/main.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/bmclient/main.cpp b/src/bmclient/main.cpp index ca890d5..0823d20 100644 --- a/src/bmclient/main.cpp +++ b/src/bmclient/main.cpp @@ -911,18 +911,25 @@ BMRequest * Executor::createGetHistoryRequest(const QStringList &args, QString * // Extract current timestamp ... int currTimestamp = args.at(17).toInt(&ok); - if (!ok) { - *error = QString( - "failed to extract current timestamp as an integer for 'get history' command"); - return 0; - } else if (currTimestamp < 0) { + if ((!ok) || (currTimestamp < 0)) { currTimestamp = -1; } + // Extract BM context ID (which overrides other values if specified) ... + int explicitBMContextId = -1; + if (BMMisc::getOption(args, "-bmcontextid", &values, 1, 0, error)) { + bool ok; + explicitBMContextId = values.at(0).toInt(&ok); + if ((!ok) || (explicitBMContextId < 0)) { + *error = "failed to extract stability tolerance as non-negative integer"; + return 0; + } + } + return new BMRequest_GetHistory( args.at(2), args.at(3), args.at(4), args.at(5), args.at(6), args.at(7), args.at(8), args.at(9), timeRange.first, timeRange.second, diffTolerance, - stabTolerance, maxSize, args.at(16), currTimestamp); + stabTolerance, maxSize, args.at(16), currTimestamp, explicitBMContextId); } BMRequest * Executor::createGetHistory2Request(const QStringList &args, QString *error) const |