From 25c021cf36e2ce1924d2fb253f147c3ed8726bf2 Mon Sep 17 00:00:00 2001 From: Wolf Bergenheim Date: Thu, 18 Nov 2010 07:43:29 +0200 Subject: Added support for the -p (prefix) flag --- resourceqt-client/commandlineparser.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'resourceqt-client/commandlineparser.cpp') diff --git a/resourceqt-client/commandlineparser.cpp b/resourceqt-client/commandlineparser.cpp index f169801..24658ea 100644 --- a/resourceqt-client/commandlineparser.cpp +++ b/resourceqt-client/commandlineparser.cpp @@ -28,7 +28,7 @@ QHash CommandLineParser::resourceValues; CommandLineParser::CommandLineParser(): allResources(), optResources(), autoRelease(false), alwaysReply(false), - verbose(false), allowUnkownResourceClass(false), output(stdout) + verbose(false), allowUnkownResourceClass(false), output(stdout), prefix("") { resourceValues["AudioPlayback"] = ResourcePolicy::AudioPlaybackType; resourceValues["VideoPlayback"] = ResourcePolicy::VideoPlaybackType; @@ -82,6 +82,9 @@ bool CommandLineParser::parseArguments() case 'v': verbose = true; break; + case 'p': + parsePrefix(*(++ci)); + break; case 'h': default: usage(); @@ -139,6 +142,16 @@ bool CommandLineParser::parseClassString(const QString &str) return true; } +void CommandLineParser::parsePrefix(const QString &str) +{ + prefix = str + ": "; +} + +QString CommandLineParser::getPrefix() const +{ + return prefix; +} + bool CommandLineParser::parseResourceList(const QString &resourceListStr, QSet &resources) { -- cgit v1.2.3