aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYang Gu <yang.gu@intel.com>2010-11-03 18:16:13 +0800
committerMarcel Holtmann <marcel@holtmann.org>2010-11-03 11:30:50 +0100
commit20690aa46e1415752d4463431d6e1f6e32a4e3df (patch)
tree24913143352e4d97aa90b48c2bfdfd841208f2fa
parentfec77237151b8172665a8dfa8f866589556ac8a7 (diff)
downloadphonesim-20690aa46e1415752d4463431d6e1f6e32a4e3df.tar.gz
Add option to support version
-rw-r--r--src/main.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index d7de416..d601ac2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -28,7 +28,7 @@ static void usage()
{
qWarning() << "Usage:"
<< QFileInfo(QCoreApplication::instance()->applicationFilePath()).fileName().toLocal8Bit().constData()
- << "[-p port] [-gui] filename";
+ << "[-v] [-p port] [-gui] filename";
exit(-1);
}
@@ -43,7 +43,10 @@ int main(int argc, char **argv)
// Parse the command-line.
index = 1;
for (index = 1; index < argc; index++) {
- if (strcmp(argv[index],"-p") == 0) {
+ if (strcmp(argv[index],"-v") == 0) {
+ qWarning() << VERSION;
+ exit(0);
+ } else if (strcmp(argv[index],"-p") == 0) {
index++;
if (index >= argc) {
qWarning() << "ERROR: Got -p but missing port number";