From patchwork Wed May 4 17:35:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Vlad X-Patchwork-Id: 9017161 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AF1E29F39D for ; Wed, 4 May 2016 17:32:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B4F80203C1 for ; Wed, 4 May 2016 17:32:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C92DC202DD for ; Wed, 4 May 2016 17:32:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F39226E16B; Wed, 4 May 2016 17:32:15 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id E5CC56E16B for ; Wed, 4 May 2016 17:32:14 +0000 (UTC) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 04 May 2016 10:32:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,578,1455004800"; d="asc'?scan'208";a="946248716" Received: from mcvlad-wk.rb.intel.com ([10.237.105.57]) by orsmga001.jf.intel.com with ESMTP; 04 May 2016 10:32:12 -0700 Received: by mcvlad-wk.rb.intel.com (Postfix, from userid 1000) id 3714AC0099; Wed, 4 May 2016 20:35:18 +0300 (EEST) Date: Wed, 4 May 2016 20:35:18 +0300 From: Marius Vlad To: Jani Nikula Message-ID: <20160504173517.GA21576@mcvlad-wk.rb.intel.com> Mail-Followup-To: Jani Nikula , intel-gfx@lists.freedesktop.org References: MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.23.1 (2014-03-12) Cc: intel-gfx@lists.freedesktop.org Subject: Re: [Intel-gfx] [PATCH i-g-t 00/17] tools/intel_bios_reader updates X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-6.3 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 Care to add this usage for it as well? Signed-off-by: Marius Vlad --- tools/intel_bios_reader.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tools/intel_bios_reader.c b/tools/intel_bios_reader.c index de90f5d..4192919 100644 --- a/tools/intel_bios_reader.c +++ b/tools/intel_bios_reader.c @@ -1414,8 +1414,22 @@ enum opt { OPT_ALL_PANELS, OPT_HEXDUMP, OPT_BLOCK, + OPT_USAGE }; +static void usage(const char *toolname) +{ + fprintf(stderr, "usage %s:", toolname); + fprintf(stderr, " --file=" + " [--devid=]" + " [--panel-type=]" + " [--all-panels]" + " [--hexdump]" + " [--block=]" + " [--help]\n"); + +} + int main(int argc, char **argv) { uint8_t *VBIOS; @@ -1443,6 +1457,7 @@ int main(int argc, char **argv) { "all-panels", no_argument, NULL, OPT_ALL_PANELS }, { "hexdump", no_argument, NULL, OPT_HEXDUMP }, { "block", required_argument, NULL, OPT_BLOCK }, + { "help", no_argument, NULL, OPT_USAGE }, { 0 } }; @@ -1484,7 +1499,9 @@ int main(int argc, char **argv) break; case OPT_END: break; + case OPT_USAGE: /* fall-through */ case OPT_UNKNOWN: + usage(toolname); return EXIT_FAILURE; } } @@ -1497,7 +1514,7 @@ int main(int argc, char **argv) /* for backwards compatibility */ filename = argv[0]; } else { - printf("usage: %s --file=\n", toolname); + usage(toolname); return EXIT_FAILURE; } }