parser.setApplicationDescription("\nSeer - A gui frontend for gdb.");
parser.setOptionsAfterPositionalArgumentsMode(QCommandLineParser::ParseAsPositionalArguments);// Treat all arguments after the executable name as positional arguments too.
parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);// Treat all arguments long options.
parser.addHelpOption();
parser.addVersionOption();
// Run or start options.
QCommandLineOptionrunOption(QStringList()<<"r"<<"run",QCoreApplication::translate("main","Load the executable and run it."));
parser.addOption(runOption);
QCommandLineOptionstartOption(QStringList()<<"s"<<"start",QCoreApplication::translate("main","Load the executable, break in main(), and run it."));
QCommandLineOptionbreakpointsOption(QStringList()<<"b"<<"breakpoints",QCoreApplication::translate("main","Optionally load a previously saved breakpoints file. For --run or --start"),"filename");
QCommandLineOptionconnectOption(QStringList()<<"connect",QCoreApplication::translate("main","Connect to a running process with gdbserver (local or remote). Manually start gdbserver first.\nPossible connection mediums are:\n host:port\n /dev/<serialdev>"),"medium");
QCommandLineOptioncorefileOption(QStringList()<<"core",QCoreApplication::translate("main","Load a corefile."),"corefile");
parser.addOption(corefileOption);
// A positional argument for executable name.
// All other arguments after that are treated as positional arguments for the executable.
parser.addPositionalArgument("executable",QCoreApplication::translate("main","The executable to debug. Needed for all run modes."));
parser.addPositionalArgument("arguments",QCoreApplication::translate("main","Arguments for the executable. Needed for --run and --start."),"[arguments ...]");
// Process the arguments.
parser.process(app);
// Get the positional arguments. (The ones at the end of the line - executable name and its arguments.