summaryrefslogtreecommitdiff
path: root/resourceqt-client/commandlineparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'resourceqt-client/commandlineparser.cpp')
-rw-r--r--resourceqt-client/commandlineparser.cpp15
1 files changed, 14 insertions, 1 deletions
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<QString, ResourcePolicy::ResourceType> 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<ResourcePolicy::ResourceType> &resources)
{