From f39660090c41763355e4ef0a660aed2c2c4c551c Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Mon, 24 Jan 2011 13:24:03 +0100 Subject: A few corrections & -qws options explained... --- fbbrowser/fbbrowser | Bin 524896 -> 524912 bytes fbbrowser/main.cpp | 11 ++++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/fbbrowser/fbbrowser b/fbbrowser/fbbrowser index c12c647..a0710ed 100755 Binary files a/fbbrowser/fbbrowser and b/fbbrowser/fbbrowser differ diff --git a/fbbrowser/main.cpp b/fbbrowser/main.cpp index 2658e6a..1355f6f 100644 --- a/fbbrowser/main.cpp +++ b/fbbrowser/main.cpp @@ -10,7 +10,11 @@ void printUsage() // Prints usage information, incomplete. // Q: How is the -qws option handled, mention it here or not? QTextStream qout(stdout); - qout << QObject::tr("Usage: ./fbbrowser [OPTIONS]") << endl; + qout << QObject::tr("Usage: ./fbbrowser [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; exit(1); } @@ -27,13 +31,14 @@ QString getPath(const char* c) int main(int argc, char *argv[]) { // Parse command line arguments. - int opt = 0; + int opt = 1; int longIndex = 0; // Declare the short options as a char*, these have exactly one - followed by letter from optString. // For example: ./fbbrowser -h // Declare the long options in the const struct, these have two - followed by a string found in longOpts[]. // Same as: ./fbbrowser --help - static const char *optString = "h?"; + // Note: I included 'qws' here to not have errors, when setting fbbrowser to be the server app aswell. + static const char *optString = "hqws"; static const struct option longOpts[] = { // If an option requires parameters, write this number instead of no_argument. -- cgit v1.2.3-55-g7522