DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yogesh Jangra <yogesh.jangra@intel.com>
To: dev@dpdk.org
Cc: cristian.dumitrescu@intel.com
Subject: [dpdk-dev] [PATCH v1] examples/pipeline: fix help command
Date: Thu, 22 Oct 2020 07:01:52 -0400	[thread overview]
Message-ID: <1603364512-48824-1-git-send-email-yogesh.jangra@intel.com> (raw)

This patch has the changes to list all supported commands and fix
supported commands help details.

Fixes: 5074e1d55107 ("examples/pipeline: add configuration commands")
Cc: cristian.dumitrescu@intel.com

Signed-off-by: Yogesh Jangra <yogesh.jangra@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 examples/pipeline/cli.c | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c
index 5800cc9..8ac6b3f 100644
--- a/examples/pipeline/cli.c
+++ b/examples/pipeline/cli.c
@@ -480,7 +480,7 @@
 static const char cmd_pipeline_port_in_help[] =
 "pipeline <pipeline_name> port in <port_id>\n"
 "   link <link_name> rxq <queue_id> bsz <burst_size>\n"
-"   source <mempool_name> <fie_name>\n";
+"   | source <mempool_name> <file_name>\n";
 
 static void
 cmd_pipeline_port_in(char **tokens,
@@ -1163,7 +1163,18 @@
 
 	if (n_tokens == 0) {
 		snprintf(out, out_size,
-			"Type 'help <command>' for command details.\n\n");
+			"Type 'help <command>' for command details.\n\n"
+			"List of commands:\n"
+			"\tmempool\n"
+			"\tlink\n"
+			"\tpipeline create\n"
+			"\tpipeline port in\n"
+			"\tpipeline port out\n"
+			"\tpipeline build\n"
+			"\tpipeline table update\n"
+			"\tpipeline stats\n"
+			"\tthread pipeline enable\n"
+			"\tthread pipeline disable\n\n");
 		return;
 	}
 
@@ -1178,20 +1189,20 @@
 	}
 
 	if ((strcmp(tokens[0], "pipeline") == 0) &&
-		((n_tokens == 1) && (strcmp(tokens[2], "create")) == 0)) {
+		(n_tokens == 2) && (strcmp(tokens[1], "create") == 0)) {
 		snprintf(out, out_size, "\n%s\n", cmd_pipeline_create_help);
 		return;
 	}
 
 	if ((strcmp(tokens[0], "pipeline") == 0) &&
-		(strcmp(tokens[1], "port") == 0)) {
-		if ((n_tokens == 3) && (strcmp(tokens[2], "in")) == 0) {
+		(n_tokens == 3) && (strcmp(tokens[1], "port") == 0)) {
+		if (strcmp(tokens[2], "in") == 0) {
 			snprintf(out, out_size, "\n%s\n",
 				cmd_pipeline_port_in_help);
 			return;
 		}
 
-		if ((n_tokens == 3) && (strcmp(tokens[2], "out")) == 0) {
+		if (strcmp(tokens[2], "out") == 0) {
 			snprintf(out, out_size, "\n%s\n",
 				cmd_pipeline_port_out_help);
 			return;
@@ -1199,20 +1210,22 @@
 	}
 
 	if ((strcmp(tokens[0], "pipeline") == 0) &&
-		((n_tokens >= 2) && (strcmp(tokens[2], "build")) == 0)) {
+		(n_tokens == 2) && (strcmp(tokens[1], "build") == 0)) {
 		snprintf(out, out_size, "\n%s\n", cmd_pipeline_build_help);
 		return;
 	}
 
 	if ((strcmp(tokens[0], "pipeline") == 0) &&
-		((n_tokens >= 2) && (strcmp(tokens[2], "table")) == 0)) {
+		(n_tokens == 3) &&
+		(strcmp(tokens[1], "table") == 0) &&
+		(strcmp(tokens[2], "update") == 0)) {
 		snprintf(out, out_size, "\n%s\n",
 			cmd_pipeline_table_update_help);
 		return;
 	}
 
 	if ((strcmp(tokens[0], "pipeline") == 0) &&
-		((n_tokens >= 2) && (strcmp(tokens[2], "stats")) == 0)) {
+		(n_tokens == 2) && (strcmp(tokens[1], "stats") == 0)) {
 		snprintf(out, out_size, "\n%s\n", cmd_pipeline_stats_help);
 		return;
 	}
-- 
1.8.3.1


             reply	other threads:[~2020-10-22 11:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22 11:01 Yogesh Jangra [this message]
2020-10-23 11:45 ` David Marchand

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=1603364512-48824-1-git-send-email-yogesh.jangra@intel.com \
    --to=yogesh.jangra@intel.com \
    --cc=cristian.dumitrescu@intel.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).