summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-11-18 07:53:46 +0200
committerWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-11-18 07:55:09 +0200
commit7cf4a74e8a1a548d74f58e7f7f16796fa11a6b61 (patch)
tree71899aea1ebdd726458882d54e0b233f65127290
parent25c021cf36e2ce1924d2fb253f147c3ed8726bf2 (diff)
downloadlibresourceqt-7cf4a74e8a1a548d74f58e7f7f16796fa11a6b61.tar.gz
Updated usage help and added timings flag -i
-rw-r--r--resourceqt-client/commandlineparser.cpp16
-rw-r--r--resourceqt-client/commandlineparser.h2
2 files changed, 15 insertions, 3 deletions
diff --git a/resourceqt-client/commandlineparser.cpp b/resourceqt-client/commandlineparser.cpp
index 24658ea..cb477fd 100644
--- a/resourceqt-client/commandlineparser.cpp
+++ b/resourceqt-client/commandlineparser.cpp
@@ -28,7 +28,8 @@ QHash<QString, ResourcePolicy::ResourceType> CommandLineParser::resourceValues;
CommandLineParser::CommandLineParser():
allResources(), optResources(), autoRelease(false), alwaysReply(false),
- verbose(false), allowUnkownResourceClass(false), output(stdout), prefix("")
+ verbose(false), allowUnkownResourceClass(false), output(stdout), prefix(""),
+ timings(false)
{
resourceValues["AudioPlayback"] = ResourcePolicy::AudioPlaybackType;
resourceValues["VideoPlayback"] = ResourcePolicy::VideoPlaybackType;
@@ -63,6 +64,8 @@ bool CommandLineParser::parseArguments()
case 'm':
case 's':
case 'i':
+ timings = true;
+ break;
case 't':
break;
case 'f':
@@ -195,11 +198,14 @@ bool CommandLineParser::parseModeValues(const QString &modeListStr)
void CommandLineParser::usage()
{
- output << "usage: resourceqt-client [-h] [-m mode-values]" <<
- "[-o optional-resources] [-s shared-resources -m shared-mask] " <<
+ output << "usage: resourceqt-client [-h] [-f mode-values]" <<
+ "[-o optional-resources] [-i] [-v] [-p prefix] " <<
"class all-resources" << endl;
output << "\toptions:" << endl;
output << "\t h\tprint this help message and exit" << endl;
+ output << "\t i\tshow timings of requests" << endl;
+ output << "\t v\tshow debug of libresourceqt" << endl;
+ output << "\t p\tPrefix all output with the given prefix" << endl;
output << "\t f\tmode values. See 'modes' below for the "
"\n\t\tsyntax of <mode-values>" << endl;
output << "\t o\toptional resources. See 'resources' below for the "
@@ -260,3 +266,7 @@ bool CommandLineParser::shouldBeVerbose() const
return verbose;
}
+bool CommandLineParser::showTimings() const
+{
+ return timings;
+}
diff --git a/resourceqt-client/commandlineparser.h b/resourceqt-client/commandlineparser.h
index 1d106f4..deab478 100644
--- a/resourceqt-client/commandlineparser.h
+++ b/resourceqt-client/commandlineparser.h
@@ -47,6 +47,7 @@ public:
bool shouldAlwaysReply() const;
bool shouldBeVerbose() const;
QString getPrefix() const;
+ bool showTimings() const;
private:
QSet<ResourcePolicy::ResourceType> allResources;
@@ -59,6 +60,7 @@ private:
bool allowUnkownResourceClass;
QTextStream output;
QString prefix;
+ bool timings;
bool parseClassString(const QString &str);
void parsePrefix(const QString &str);