diff mbox

[Branch,~glcompbench-dev/glcompbench/trunk] Rev 36: Add short versions of some command line options.

Message ID 20110623142315.3922.28580.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

alexandros.frantzis@linaro.org June 23, 2011, 2:23 p.m. UTC
------------------------------------------------------------
revno: 36
committer: Alexandros Frantzis <alexandros.frantzis@linaro.org>
branch nick: trunk
timestamp: Thu 2011-06-23 17:18:23 +0300
message:
  Add short versions of some command line options.
modified:
  src/options.cc


--
lp:glcompbench
https://code.launchpad.net/~glcompbench-dev/glcompbench/trunk

You are subscribed to branch lp:glcompbench.
To unsubscribe from this branch go to https://code.launchpad.net/~glcompbench-dev/glcompbench/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'src/options.cc'
--- src/options.cc	2011-06-23 14:13:00 +0000
+++ src/options.cc	2011-06-23 14:18:23 +0000
@@ -80,23 +80,23 @@ 
     printf("An EGL/GLES2.0 example of using EGL_KHR_image_pixmap with XComposite.\n"
            "\n"
            "Options:\n"
-           "  --ids <IDs>        A comma separated list of window ids to track\n"
-           "                     (base 10 or 16)\n"
-           "  --size <SIZE>      The size of each side of the main window in pixels\n"
-           "                     [default: 512]\n"
-           "  --no-accel-tfp     Don't use accelerated TFP (use glTexImage2D)\n"
-           "  --benchmark BENCH  A benchmark to run: 'test(:opt1=val1)*'\n"
-           "                     (the option can be used multiple times)\n"
-           "  --no-draw          Process the windows but don't draw anything on screen\n"
-           "  --idle-redraw      Redraw when idle, even when nothing has changed\n"
-           "  --force-tex-update Force texture updates even when they are unchanged\n"
-           "  --manual-redirect  Perform a manual redirect when using XComposite\n"
-           "  --run-forever      Run indefinitely, looping from the last test back to the first\n"
-           "  --list-tests       List the avalaible tests and their options\n"
-           "  --no-swap-buffers  Don't update the screen by swapping the front and\n"
-           "                     back buffer, use glFinish() instead\n"
-           "  --debug            Display debug messages\n"
-           "  --help             Display help\n");
+           "  -i, --ids IDs          A comma separated list of window ids to track\n"
+           "                         (base 10 or 16)\n"
+           "  -s, --size SIZE        The size of each side of the main window in pixels\n"
+           "                         [default: 512]\n"
+           "      --no-accel-tfp     Don't use accelerated TFP (use glTexImage2D)\n"
+           "  -b, --benchmark BENCH  A benchmark to run: 'test(:opt1=val1)*'\n"
+           "                         (the option can be used multiple times)\n"
+           "      --no-draw          Process the windows but don't draw anything on screen\n"
+           "      --idle-redraw      Redraw when idle, even when nothing has changed\n"
+           "      --force-tex-update Force texture updates even when they are unchanged\n"
+           "      --manual-redirect  Perform a manual redirect when using XComposite\n"
+           "      --run-forever      Run indefinitely, looping from the last test back to the first\n"
+           "  -l, --list-tests       List the avalaible tests and their options\n"
+           "      --no-swap-buffers  Don't update the screen by swapping the front and\n"
+           "                         back buffer, use glFinish() instead\n"
+           "  -d, --debug            Display debug messages\n"
+           "  -h, --help             Display help\n");
 }
 
 bool
@@ -107,7 +107,7 @@ 
         int c;
         const char *optname = "";
 
-        c = getopt_long(argc, argv, "",
+        c = getopt_long(argc, argv, "i:s:b:ldh",
                         long_options, &option_index);
         if (c == -1)
             break;
@@ -117,13 +117,13 @@ 
         if (option_index != -1)
             optname = long_options[option_index].name;
 
-        if (!strcmp(optname, "ids"))
+        if (c == 'i' || !strcmp(optname, "ids"))
             parse_window_ids(optarg, Options::window_ids);
-        else if (!strcmp(optname, "size"))
+        else if (c == 's' || !strcmp(optname, "size"))
             Options::size = strtol(optarg, NULL, 10);
         else if (!strcmp(optname, "no-accel-tfp"))
             Options::use_accel_tfp = false;
-        else if (!strcmp(optname, "benchmark"))
+        else if (c == 'b' || !strcmp(optname, "benchmark"))
             Options::benchmarks.push_back(optarg);
         else if (!strcmp(optname, "no-draw"))
             Options::draw = false;
@@ -133,15 +133,15 @@ 
             Options::force_tex_update = true;
         else if (!strcmp(optname, "run-forever"))
             Options::run_forever = true;
-        else if (!strcmp(optname, "list-tests"))
+        else if (c == 'l' || !strcmp(optname, "list-tests"))
             Options::list_tests = true;
         else if (!strcmp(optname, "manual-redirect"))
             Options::manual_redirect = true;
         else if (!strcmp(optname, "no-swap-buffers"))
             Options::swap_buffers = false;
-        else if (!strcmp(optname, "debug"))
+        else if (c == 'd' || !strcmp(optname, "debug"))
             Options::show_debug = true;
-        else if (!strcmp(optname, "help"))
+        else if (c == 'h' || !strcmp(optname, "help"))
             Options::show_help = true;
     }