From patchwork Thu Oct 10 11:23:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 3015391 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 80A5C9F243 for ; Thu, 10 Oct 2013 11:25:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 89BAE20319 for ; Thu, 10 Oct 2013 11:25:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5D6472030E for ; Thu, 10 Oct 2013 11:25:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5F37CE6858 for ; Thu, 10 Oct 2013 04:25:52 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org 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) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=9jjG1hNGky9Kx4lqG6nCBdGtSOJu/mYsavYAeU9/w5Q=; b=MwCsZRhi6GmTT1Uob2gbhlswMJNwAUqnY5zfjHRnj24NAEIFTNN6/yI7rmD0We48tM IAYOruQo5zif4/Srwy//rTFZGi8Y58hl6MsgYsQ7V/zfdox38cpUyb2nzFEnUlDsaU7C qwngviR2kP5uZmZ6MZaSIVOReWti0tRG9EDdJ3FsBvrtdxXb9sip6Wth2c/WyaJfzf0d L9HGZj/2htzYSQW5tS6tHY7uP38u5c2kJ1UrugKJMTvH5gYs5VZZiZmrneZwId/o8Mz8 5axQ0LfmfmcjN1PlTo7yuAZKFsqcjiJqP0S1ObeTRgrOv9D2THc/mJVlYUYUEldOaaMB xjAQ== X-Gm-Message-State: ALoCoQnBkx+Mt++W+GMNDxQoEqFNufq787LJR13+rBFb3bEbIYELpcRkvIePHbLZtFOcDEE6XlE4 X-Received: by 10.180.39.212 with SMTP id r20mr7285724wik.13.1381404201040; Thu, 10 Oct 2013 04:23:21 -0700 (PDT) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id bi4sm729386wib.0.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 10 Oct 2013 04:23:20 -0700 (PDT) From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Thu, 10 Oct 2013 12:23:19 +0100 Message-Id: <1381404199-10820-1-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [Intel-gfx] [PATCH i-g-t] testdisplay: Allow getopt to print error messages X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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]);