DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] scripts: fix checkpatch help
Date: Tue, 16 Feb 2016 15:36:54 +0100	[thread overview]
Message-ID: <1455633414-4778-1-git-send-email-olivier.matz@6wind.com> (raw)

When started without defining DPDK_CHECKPATCH_PATH, the usage was not
displayed.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 scripts/checkpatches.sh | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/scripts/checkpatches.sh b/scripts/checkpatches.sh
index afc611b..1e765e3 100755
--- a/scripts/checkpatches.sh
+++ b/scripts/checkpatches.sh
@@ -34,10 +34,6 @@
 # - DPDK_CHECKPATCH_PATH
 # - DPDK_CHECKPATCH_LINE_LENGTH
 . scripts/load-devel-config.sh
-if [ ! -x "$DPDK_CHECKPATCH_PATH" ] ; then
-	echo 'Cannot execute DPDK_CHECKPATCH_PATH' >&2
-	exit 1
-fi
 
 length=${DPDK_CHECKPATCH_LINE_LENGTH:-80}
 
@@ -51,7 +47,12 @@ SPLIT_STRING,LINE_SPACING,PARENTHESIS_ALIGNMENT,NETWORKING_BLOCK_COMMENT_STYLE,\
 NEW_TYPEDEFS,COMPARISON_TO_NULL"
 
 print_usage () {
-	echo "usage: $(basename $0) [-q] [-v] [patch1 [patch2] ...]]"
+	cat <<- END_OF_HELP
+	usage: $(basename $0) [-q] [-v] [patch1 [patch2] ...]]
+
+	Run Linux kernel checkpatch.pl with DPDK options.
+	The environment variable DPDK_CHECKPATCH_PATH must be set.
+	END_OF_HELP
 }
 
 quiet=false
@@ -66,6 +67,13 @@ while getopts hqv ARG ; do
 done
 shift $(($OPTIND - 1))
 
+if [ ! -x "$DPDK_CHECKPATCH_PATH" ] ; then
+	print_usage
+	echo
+	echo 'Cannot execute DPDK_CHECKPATCH_PATH' >&2
+	exit 1
+fi
+
 status=0
 for p in "$@" ; do
 	! $verbose || printf '\n### %s\n\n' "$p"
-- 
2.1.4

             reply	other threads:[~2016-02-16 14:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-16 14:36 Olivier Matz [this message]
2016-03-24 21:19 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455633414-4778-1-git-send-email-olivier.matz@6wind.com \
    --to=olivier.matz@6wind.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).