From patchwork Tue Dec 11 16:22:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 1011192 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43DlbT3wxLz9s3l for ; Wed, 12 Dec 2018 03:22:45 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 2F60BC225DC; Tue, 11 Dec 2018 16:22:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 1C0E9C225B9; Tue, 11 Dec 2018 16:22:36 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EE72DC225B9; Tue, 11 Dec 2018 16:22:33 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lists.denx.de (Postfix) with ESMTPS id 151F0C22277 for ; Tue, 11 Dec 2018 16:22:32 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2018 08:22:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,342,1539673200"; d="scan'208";a="109515079" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 11 Dec 2018 08:22:29 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id DE94D1CB; Tue, 11 Dec 2018 18:22:28 +0200 (EET) From: Andy Shevchenko To: Simon Glass , Bin Meng , u-boot@lists.denx.de Date: Tue, 11 Dec 2018 18:22:28 +0200 Message-Id: <20181211162228.60021-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Cc: Andy Shevchenko Subject: [U-Boot] [PATCH v1] scripts/check-config.sh: Add usage() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" When arguments are not supplied the error message is misleading and doesn't tell what exactly has to be done. Fix this by adding usage() and call it if above circumstance occurs. Signed-off-by: Andy Shevchenko Reviewed-by: Simon Glass --- scripts/check-config.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/check-config.sh b/scripts/check-config.sh index 4848ca6e25..583f7d0963 100755 --- a/scripts/check-config.sh +++ b/scripts/check-config.sh @@ -17,6 +17,15 @@ set -e set -u +PROG_NAME="${0##*/}" + +usage() { + echo "$PROG_NAME " + exit 1 +} + +[ $# -ge 3 ] || usage + path="$1" whitelist="$2" srctree="$3"