From f10f6dd6dc6fae0d6bf35ecf3b60e17da050a414 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Sat, 5 Mar 2011 20:54:04 +0100 Subject: printUsage updated, random ideas... --- src/fbgui.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/fbgui.cpp b/src/fbgui.cpp index 3fad734..c6f7e0d 100644 --- a/src/fbgui.cpp +++ b/src/fbgui.cpp @@ -12,11 +12,12 @@ void printUsage() // Prints usage information. // TODO: Complete usage info. QTextStream qout(stdout); - qout << QObject::tr("Usage: ./fbgui [OPTIONS] ") << endl; + qout << QObject::tr("Usage: ./fbgui [OPTIONS]") << endl; qout << QObject::tr("Options:") << endl; - qout << "-h or --help " << QObject::tr("Prints usage information.") << endl; - qout << "-qws " << QObject::tr("Set this application to also be the server application.") << endl; - qout << " " << QObject::tr("Skip this option if you have a QT server application") << endl; + qout << "-u , --url= " << QObject::tr("Set which URL to load.") << endl; + qout << "-h, --help " << QObject::tr("Prints usage information.") << endl; + // qout << "-qws " << QObject::tr("Set this application to also be the server application.") << endl; + // qout << " " << QObject::tr("Skip this option if you have a QT server application") << endl; exit(1); } @@ -34,6 +35,10 @@ int main(int argc, char *argv[]) /* SETTINGS TEST */ CommandLineOptions clOptions(argc, argv); + // TODO: Use QSettings for accessing the ini file but + // check first if option was set from cmdline. + // (if it was, dont set it from ini). + // Check if help was requested, if so printUsage() and exit. if (clOptions.contains("help")) { @@ -46,8 +51,8 @@ int main(int argc, char *argv[]) return EXIT_SUCCESS; } - // Check if URL was given at cmdline argument, - // if not set default. + // Check if URL was given at cmdline argument, if not set default. + // TODO: fix short options parsing, doesn't work atm. QUrl url; if (clOptions.contains("url")) url = clOptions.value("url"); -- cgit v1.2.3-55-g7522