X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=gui%2Fmain.cpp;h=121e323a3344f4dae5a8d827afad3d7977888d16;hb=7257dfcc57b3a1af576a8a2ca69992ae8d77dea4;hp=471dec7939c7eccd88c4d1c882a121ea2a587b08;hpb=db3491e272f3754676673d52c89238e9cc43b7ad;p=apitrace diff --git a/gui/main.cpp b/gui/main.cpp index 471dec7..121e323 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -11,6 +11,8 @@ #include #include +#include + Q_DECLARE_METATYPE(QList); Q_DECLARE_METATYPE(QVector); Q_DECLARE_METATYPE(Qt::CaseSensitivity); @@ -20,7 +22,10 @@ Q_DECLARE_METATYPE(QList); static void usage(void) { - qWarning("usage: qapitrace [TRACE] [CALLNO]\n"); + qWarning("usage: qapitrace [options] [TRACE] [CALLNO]\n" + "Valid options include:\n" + " -h, --help Print this help message\n" + " --remote-target HOST Replay trace on remote target HOST\n"); } int main(int argc, char **argv) @@ -45,6 +50,7 @@ int main(int argc, char **argv) #endif QStringList args = app.arguments(); + QString remoteTarget; int i = 1; while (i < args.count()) { @@ -55,6 +61,13 @@ int main(int argc, char **argv) ++i; if (arg == QLatin1String("--")) { break; + } else if (arg == QLatin1String("--remote-target")) { + if (i == args.count()) { + qWarning("Option --remote-target requires an argument.\n"); + exit(1); + } + remoteTarget = args[i]; + ++i; } else if (arg == QLatin1String("-h") || arg == QLatin1String("--help")) { usage(); @@ -78,5 +91,9 @@ int main(int argc, char **argv) window.loadTrace(fileName, callNum); } + if (remoteTarget.length()) { + window.setRemoteTarget(remoteTarget); + } + app.exec(); }