From: Thomas Wood Subject: [PATCH i-g-t] testdisplay: Allow getopt to print error messages Date: Thu, 10 Oct 2013 12:23:19 +0100 Message-ID: <1381404199-10820-1-git-send-email-thomas.wood@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by gabe.freedesktop.org (Postfix) with ESMTP id E19CFE6815 for ; Thu, 10 Oct 2013 04:23:21 -0700 (PDT) Received: by mail-wi0-f169.google.com with SMTP id cb5so2126353wib.0 for ; Thu, 10 Oct 2013 04:23:21 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org By not assigning opterr, getopt will print its own error message that includes information about whether an option is unknown or just requires an additional argument. Signed-off-by: Thomas Wood --- tests/testdisplay.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/testdisplay.c b/tests/testdisplay.c index 0fcce19..a0f43e9 100644 --- a/tests/testdisplay.c +++ b/tests/testdisplay.c @@ -723,7 +723,6 @@ int main(int argc, char **argv) enter_exec_path( argv ); - opterr = 0; while ((c = getopt(argc, argv, optstr)) != -1) { switch (c) { case '3': @@ -771,7 +770,6 @@ int main(int argc, char **argv) sscanf(optarg, "%d,%d", &specified_disp_id, &specified_mode_num); break; default: - fprintf(stderr, "unknown option %c\n", c); /* fall through */ case 'h': usage(argv[0]); -- 1.8.3.1