From patchwork Thu Jun 23 14:23:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexandros.frantzis@linaro.org X-Patchwork-Id: 2217 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A82BB23F6D for ; Thu, 23 Jun 2011 14:23:22 +0000 (UTC) Received: from mail-qy0-f173.google.com (mail-qy0-f173.google.com [209.85.216.173]) by fiordland.canonical.com (Postfix) with ESMTP id 64D56A189B3 for ; Thu, 23 Jun 2011 14:23:22 +0000 (UTC) Received: by mail-qy0-f173.google.com with SMTP id 10so3831525qyk.11 for ; Thu, 23 Jun 2011 07:23:22 -0700 (PDT) Received: by 10.229.40.139 with SMTP id k11mr1604996qce.135.1308839002131; Thu, 23 Jun 2011 07:23:22 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.230.139 with SMTP id jm11cs19231qcb; Thu, 23 Jun 2011 07:23:21 -0700 (PDT) Received: by 10.227.148.220 with SMTP id q28mr2083547wbv.29.1308838996737; Thu, 23 Jun 2011 07:23:16 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id e7si3913874wbh.139.2011.06.23.07.23.16; Thu, 23 Jun 2011 07:23:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=bounces@canonical.com Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QZkoN-0003mp-Ju for ; Thu, 23 Jun 2011 14:23:15 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 9351A2E8911 for ; Thu, 23 Jun 2011 14:23:15 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: glcompbench X-Launchpad-Branch: ~glcompbench-dev/glcompbench/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 36 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~glcompbench-dev/glcompbench/trunk] Rev 36: Add short versions of some command line options. Message-Id: <20110623142315.3922.28580.launchpad@loganberry.canonical.com> Date: Thu, 23 Jun 2011 14:23:15 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13265"; Instance="initZopeless config overlay" X-Launchpad-Hash: c181166bed51f9d987afc4c6a9ea85bd3d2130e9 ------------------------------------------------------------ revno: 36 committer: Alexandros Frantzis 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 === 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 A comma separated list of window ids to track\n" - " (base 10 or 16)\n" - " --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; }