#include #include #include "fbsplash.h" void printHelp(){ QTextStream qout(stdout); qout << "Usage: ./fbsplash [OPTIONS]\n"; qout << "Options:\n"; qout << "-h, --help " << "Prints this help.\n"; qout.flush(); exit(EXIT_SUCCESS); } int main(int argc, char *argv[]) { QApplication app(argc, argv, QApplication::GuiServer); app.setOrganizationName("OpenSLX"); app.setApplicationName("fbsplash"); // Command line arguements parsing QMap clOpts; int longIndex = 0; static const char *optString = "c:u:d:s:t:D:hl:"; static const struct option longOpts[] = { { "help", no_argument, NULL, 'h' } }; int opt = getopt_long(argc, argv, optString, longOpts, &longIndex); while (opt != -1) { switch (opt) { case 'h': clOpts.insert("help", "help"); break; } opt = getopt_long(argc, argv, optString, longOpts, &longIndex); } if (clOpts.contains("help")) printHelp(); // fbsplash init fbsplash bs; app.exec(); }