diff mbox series

[U-Boot,v1] scripts/check-config.sh: Add usage()

Message ID 20181211162228.60021-1-andriy.shevchenko@linux.intel.com
State Accepted
Commit 94ca269049e2a57107c3d7a3713e8bfd054a2153
Delegated to: Tom Rini
Headers show
Series [U-Boot,v1] scripts/check-config.sh: Add usage() | expand

Commit Message

Andy Shevchenko Dec. 11, 2018, 4:22 p.m. UTC
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 <andriy.shevchenko@linux.intel.com>
---
 scripts/check-config.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Simon Glass Dec. 20, 2018, 9:16 p.m. UTC | #1
On Tue, 11 Dec 2018 at 09:22, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> 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 <andriy.shevchenko@linux.intel.com>
> ---
>  scripts/check-config.sh | 9 +++++++++
>  1 file changed, 9 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini Dec. 27, 2018, 3:47 p.m. UTC | #2
On Tue, Dec 11, 2018 at 06:22:28PM +0200, Andy Shevchenko wrote:

> 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 <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

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 <path to u-boot.cfg> <path to whitelist file> <source dir>"
+	exit 1
+}
+
+[ $# -ge 3 ] || usage
+
 path="$1"
 whitelist="$2"
 srctree="$3"