X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=gui%2Fmain.cpp;h=b98bce60dcff045238890051f990c7bc502c8554;hb=ff6dad3ca0f52fb91b5035843df7da79126291e1;hp=471dec7939c7eccd88c4d1c882a121ea2a587b08;hpb=db3491e272f3754676673d52c89238e9cc43b7ad;p=apitrace diff --git a/gui/main.cpp b/gui/main.cpp index 471dec7..b98bce6 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -1,3 +1,5 @@ +#include + #include "mainwindow.h" #include "apitrace.h" @@ -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(); }