From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6903EA04DD; Thu, 22 Oct 2020 12:40:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BE06AA993; Thu, 22 Oct 2020 12:40:49 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 6B07BA98F for ; Thu, 22 Oct 2020 12:40:47 +0200 (CEST) IronPort-SDR: T8hcqJm4XKqUoy7FZqjoDCamGNVYlxdNpHnETyng/bAV/1qdYFpm/ybtP0stLOp7x5W0sLCg2d f/KeG0xP/sRA== X-IronPort-AV: E=McAfee;i="6000,8403,9781"; a="166725540" X-IronPort-AV: E=Sophos;i="5.77,404,1596524400"; d="scan'208";a="166725540" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2020 03:40:45 -0700 IronPort-SDR: 3tGXNs+Bt4oDqQ2VxKG8ULbdzV3EjruRTdZjBnIiVbQTWnfGIoZtmCgfH5BN7DzEKENX2Majzh iwUzsx+TBw5Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,404,1596524400"; d="scan'208";a="348702778" Received: from unknown (HELO bdcdev09.localdomain) ([10.190.193.143]) by fmsmga004.fm.intel.com with ESMTP; 22 Oct 2020 03:40:44 -0700 From: Yogesh Jangra To: dev@dpdk.org Cc: cristian.dumitrescu@intel.com Date: Thu, 22 Oct 2020 06:39:34 -0400 Message-Id: <1603363174-22370-1-git-send-email-yogesh.jangra@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] examples/pipeline: fix help command X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Acked-by: Cristian Dumitrescu --- 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..bababba 100644 --- a/examples/pipeline/cli.c +++ b/examples/pipeline/cli.c @@ -480,7 +480,7 @@ static const char cmd_pipeline_port_in_help[] = "pipeline port in \n" " link rxq bsz \n" -" source \n"; +" | source \n"; static void cmd_pipeline_port_in(char **tokens, @@ -1163,7 +1163,18 @@ if (n_tokens == 0) { snprintf(out, out_size, - "Type 'help ' for command details.\n\n"); + "Type 'help ' 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