#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; static const char *optString = "h"; static const struct option longOpts[] = { { "help", no_argument, NULL, 'h' } }; int longIndex = 0; 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(); }