diff options
| author | Jonathan Bauer | 2011-03-05 23:07:17 +0100 |
|---|---|---|
| committer | Jonathan Bauer | 2011-03-05 23:07:17 +0100 |
| commit | b8a27aee192e3ad06eeb8fd3dcf1e525a88bc115 (patch) | |
| tree | fd8fdfc478b7a672b0398eabff0e579258acd099 | |
| parent | more random things... (diff) | |
| download | fbgui-b8a27aee192e3ad06eeb8fd3dcf1e525a88bc115.tar.gz fbgui-b8a27aee192e3ad06eeb8fd3dcf1e525a88bc115.tar.xz fbgui-b8a27aee192e3ad06eeb8fd3dcf1e525a88bc115.zip | |
url short option fixed
| -rw-r--r-- | src/CommandLineOptions.cpp | 5 | ||||
| -rw-r--r-- | src/fbgui.cpp | 1 | ||||
| -rwxr-xr-x | src/testApp.sh | 2 |
3 files changed, 2 insertions, 6 deletions
diff --git a/src/CommandLineOptions.cpp b/src/CommandLineOptions.cpp index 67135f2..945cff9 100644 --- a/src/CommandLineOptions.cpp +++ b/src/CommandLineOptions.cpp @@ -13,12 +13,9 @@ CommandLineOptions::CommandLineOptions(int argc, char * const argv[]){ qDebug() << i << " argument: " << argv[i]; // Parse command line arguments. int longIndex = 0; - // TODO: clean output... - static const char *optString = "uh"; + static const char *optString = "u:h"; static const struct option longOpts[] = { - // If an option requires parameters, write this number instead of no_argument. - // The last argument, is the corresponding char to the option string. {"url", required_argument, NULL, 'u'}, {"help", no_argument, NULL, 'h'} }; diff --git a/src/fbgui.cpp b/src/fbgui.cpp index 57df27b..d7fc65e 100644 --- a/src/fbgui.cpp +++ b/src/fbgui.cpp @@ -49,7 +49,6 @@ int main(int argc, char *argv[]) } // 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"); diff --git a/src/testApp.sh b/src/testApp.sh index 3949361..18010e0 100755 --- a/src/testApp.sh +++ b/src/testApp.sh @@ -18,7 +18,7 @@ display_id=$(grep -n $(whoami) /etc/passwd| head -n 1|awk -F : '{print $1}') # Wait for it to load (needed?) Probably not ;o sleep 1 # Start fbgui. -$working_path/fbgui -display QVFb:$display_id --url=$url +$working_path/fbgui -display QVFb:$display_id -u $url # Check if fbbrowser is not running, if so kill the qvfb. if [ $(ps aux | grep -v grep | grep -c fbgui) -eq 1 ] then |
