DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: david.marchand@redhat.com, bruce.richardson@intel.com,
	mb@smartsharesystems.com,
	Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,
	Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>,
	Dmitry Malloy <dmitrym@microsoft.com>,
	Pallavi Kadam <pallavi.kadam@intel.com>
Subject: [dpdk-dev] [PATCH v3 02/11] eal: improve options usage text
Date: Fri, 12 Mar 2021 19:17:11 +0100	[thread overview]
Message-ID: <20210312181720.242252-3-thomas@monjalon.net> (raw)
In-Reply-To: <20210312181720.242252-1-thomas@monjalon.net>

The description of the EAL options was printed before the application
description provided via the hook.
It is better to let the application print the global syntax
and describes the detail of the EAL options below.

Also, some useless lines are removed,
and the alignment of few options is fixed.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 lib/librte_eal/common/eal_common_options.c | 11 +++++------
 lib/librte_eal/freebsd/eal.c               |  8 ++++----
 lib/librte_eal/linux/eal.c                 | 12 ++++++------
 lib/librte_eal/windows/eal.c               | 10 ++++------
 4 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index 622c7bc429..0635b0d4ce 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -2022,8 +2022,7 @@ rte_vect_set_max_simd_bitwidth(uint16_t bitwidth)
 void
 eal_common_usage(void)
 {
-	printf("[options]\n\n"
-	       "EAL common options:\n"
+	printf("EAL common options:\n"
 	       "  -c COREMASK         Hexadecimal bitmask of cores to run on\n"
 	       "  -l CORELIST         List of cores to run on\n"
 	       "                      The argument format is <c1>[-c2][,c3[-c4],...]\n"
@@ -2053,7 +2052,7 @@ eal_common_usage(void)
 	       "  --"OPT_VDEV"              Add a virtual device.\n"
 	       "                      The argument format is <driver><id>[,key=val,...]\n"
 	       "                      (ex: --vdev=net_pcap0,iface=eth2).\n"
-	       "  --"OPT_IOVA_MODE"   Set IOVA mode. 'pa' for IOVA_PA\n"
+	       "  --"OPT_IOVA_MODE"         Set IOVA mode. 'pa' for IOVA_PA\n"
 	       "                      'va' for IOVA_VA\n"
 	       "  -d LIB.so|DIR       Add a driver or driver directory\n"
 	       "                      (can be used multiple times)\n"
@@ -2092,11 +2091,11 @@ eal_common_usage(void)
 #endif /* !RTE_EXEC_ENV_WINDOWS */
 	       "  -v                  Display version information on startup\n"
 	       "  -h, --help          This help\n"
-	       "  --"OPT_IN_MEMORY"   Operate entirely in memory. This will\n"
+	       "  --"OPT_IN_MEMORY"         Operate entirely in memory. This will\n"
 	       "                      disable secondary process support\n"
 	       "  --"OPT_BASE_VIRTADDR"     Base virtual address\n"
-	       "  --"OPT_TELEMETRY"   Enable telemetry support (on by default)\n"
-	       "  --"OPT_NO_TELEMETRY"   Disable telemetry support\n"
+	       "  --"OPT_TELEMETRY"         Enable telemetry support (on by default)\n"
+	       "  --"OPT_NO_TELEMETRY"      Disable telemetry support\n"
 	       "  --"OPT_FORCE_MAX_SIMD_BITWIDTH" Force the max SIMD bitwidth\n"
 	       "\nEAL options for DEBUG use only:\n"
 	       "  --"OPT_HUGE_UNLINK"       Unlink hugepage files after init\n"
diff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c
index afbbb1c523..f466616566 100644
--- a/lib/librte_eal/freebsd/eal.c
+++ b/lib/librte_eal/freebsd/eal.c
@@ -421,13 +421,13 @@ eal_usage(const char *prgname)
 {
 	rte_usage_hook_t hook = eal_get_application_usage_hook();
 
-	printf("\nUsage: %s ", prgname);
-	eal_common_usage();
-	/* Allow the application to print its usage message too if hook is set */
 	if (hook) {
-		printf("===== Application Usage =====\n\n");
+		/* Print application usage through EAL options parsing. */
 		(hook)(prgname);
+		printf("\n");
 	}
+
+	eal_common_usage();
 }
 
 static inline size_t
diff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c
index bc966150a5..7c1d296192 100644
--- a/lib/librte_eal/linux/eal.c
+++ b/lib/librte_eal/linux/eal.c
@@ -534,7 +534,12 @@ eal_usage(const char *prgname)
 {
 	rte_usage_hook_t hook = eal_get_application_usage_hook();
 
-	printf("\nUsage: %s ", prgname);
+	if (hook) {
+		/* Print application usage through EAL options parsing. */
+		(hook)(prgname);
+		printf("\n");
+	}
+
 	eal_common_usage();
 	printf("EAL Linux options:\n"
 	       "  --"OPT_SOCKET_MEM"        Memory to allocate on sockets (comma separated values)\n"
@@ -548,11 +553,6 @@ eal_usage(const char *prgname)
 	       "  --"OPT_SINGLE_FILE_SEGMENTS" Put all hugepage memory in single files\n"
 	       "  --"OPT_MATCH_ALLOCATIONS" Free hugepages exactly as allocated\n"
 	       "\n");
-	/* Allow the application to print its usage message too if hook is set */
-	if (hook) {
-		printf("===== Application Usage =====\n\n");
-		(hook)(prgname);
-	}
 }
 
 static int
diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c
index 2fc3d6141c..ec13ac1a9f 100644
--- a/lib/librte_eal/windows/eal.c
+++ b/lib/librte_eal/windows/eal.c
@@ -79,15 +79,13 @@ eal_usage(const char *prgname)
 {
 	rte_usage_hook_t hook = eal_get_application_usage_hook();
 
-	printf("\nUsage: %s ", prgname);
-	eal_common_usage();
-	/* Allow the application to print its usage message too
-	 * if hook is set
-	 */
 	if (hook) {
-		printf("===== Application Usage =====\n\n");
+		/* Print application usage through EAL options parsing. */
 		(hook)(prgname);
+		printf("\n");
 	}
+
+	eal_common_usage();
 }
 
 /* Parse the arguments for --log-level only */
-- 
2.30.1


  parent reply	other threads:[~2021-03-12 18:17 UTC|newest]

Thread overview: 131+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09 23:31 [dpdk-dev] [PATCH 00/11] improve options help Thomas Monjalon
2021-03-09 23:31 ` [dpdk-dev] [PATCH 01/11] eal: explain argv behaviour during init Thomas Monjalon
2021-03-09 23:31 ` [dpdk-dev] [PATCH 02/11] eal: improve options usage text Thomas Monjalon
2021-03-09 23:31 ` [dpdk-dev] [PATCH 03/11] eal: use macros for help option Thomas Monjalon
2021-03-09 23:31 ` [dpdk-dev] [PATCH 04/11] eal: move private log functions Thomas Monjalon
2021-03-09 23:31 ` [dpdk-dev] [PATCH 05/11] eal: introduce maximum log level macro Thomas Monjalon
2021-03-10 12:46   ` Thomas Monjalon
2021-03-09 23:31 ` [dpdk-dev] [PATCH 06/11] eal: catch invalid log level number Thomas Monjalon
2021-03-10 12:19   ` Bruce Richardson
2021-03-10 12:33     ` Thomas Monjalon
2021-03-10 13:26       ` Bruce Richardson
2021-03-10 13:35         ` Thomas Monjalon
2021-03-10 16:35           ` Morten Brørup
2021-03-10 16:52           ` Bruce Richardson
2021-03-10 15:16     ` Stephen Hemminger
2021-03-09 23:31 ` [dpdk-dev] [PATCH 07/11] eal: add log level help Thomas Monjalon
2023-06-29 16:22   ` Stephen Hemminger
2021-03-09 23:31 ` [dpdk-dev] [PATCH 08/11] app: fix exit messages Thomas Monjalon
2021-03-10  7:10   ` Ori Kam
2021-03-10  9:23   ` Wisam Monther
2021-03-09 23:31 ` [dpdk-dev] [PATCH 09/11] app: hook in EAL usage help Thomas Monjalon
2021-03-10  9:25   ` Wisam Monther
2021-03-09 23:31 ` [dpdk-dev] [PATCH 10/11] app/regex: fix usage text Thomas Monjalon
2021-03-10  7:08   ` Ori Kam
2021-03-09 23:31 ` [dpdk-dev] [PATCH 11/11] app/testpmd: " Thomas Monjalon
2021-03-12 19:09   ` Ajit Khaparde
2021-03-10  0:45 ` [dpdk-dev] [PATCH 00/11] improve options help Stephen Hemminger
2021-03-10 13:28 ` [dpdk-dev] [PATCH v2 " Thomas Monjalon
2021-03-10 13:28   ` [dpdk-dev] [PATCH v2 01/11] eal: explain argv behaviour during init Thomas Monjalon
2023-06-30 16:23     ` Stephen Hemminger
2021-03-10 13:28   ` [dpdk-dev] [PATCH v2 02/11] eal: improve options usage text Thomas Monjalon
2021-03-10 13:28   ` [dpdk-dev] [PATCH v2 03/11] eal: use macros for help option Thomas Monjalon
2021-03-10 13:28   ` [dpdk-dev] [PATCH v2 04/11] eal: move private log functions Thomas Monjalon
2021-03-10 13:28   ` [dpdk-dev] [PATCH v2 05/11] eal: introduce maximum log level macro Thomas Monjalon
2021-03-10 13:28   ` [dpdk-dev] [PATCH v2 06/11] eal: catch invalid log level number Thomas Monjalon
2021-03-10 13:28   ` [dpdk-dev] [PATCH v2 07/11] eal: add log level help Thomas Monjalon
2021-03-10 13:28   ` [dpdk-dev] [PATCH v2 08/11] app: fix exit messages Thomas Monjalon
2021-03-10 13:28   ` [dpdk-dev] [PATCH v2 09/11] app: hook in EAL usage help Thomas Monjalon
2021-03-10 13:28   ` [dpdk-dev] [PATCH v2 10/11] app/regex: fix usage text Thomas Monjalon
2021-03-10 13:28   ` [dpdk-dev] [PATCH v2 11/11] app/testpmd: " Thomas Monjalon
2021-03-12 18:17 ` [dpdk-dev] [PATCH v3 00/11] improve options help Thomas Monjalon
2021-03-12 18:17   ` [dpdk-dev] [PATCH v3 01/11] eal: explain argv behaviour during init Thomas Monjalon
2021-03-12 18:17   ` Thomas Monjalon [this message]
2021-03-12 18:17   ` [dpdk-dev] [PATCH v3 03/11] eal: use macros for help option Thomas Monjalon
2021-03-12 18:17   ` [dpdk-dev] [PATCH v3 04/11] eal: move private log functions Thomas Monjalon
2021-03-12 18:17   ` [dpdk-dev] [PATCH v3 05/11] eal: introduce maximum log level macro Thomas Monjalon
2021-03-12 18:17   ` [dpdk-dev] [PATCH v3 06/11] eal: catch invalid log level number Thomas Monjalon
2021-03-12 18:17   ` [dpdk-dev] [PATCH v3 07/11] eal: add log level help Thomas Monjalon
2021-03-15 10:19     ` Kinsella, Ray
2021-03-15 10:31       ` Bruce Richardson
2021-03-15 10:42         ` Kinsella, Ray
2021-03-15 10:52           ` Thomas Monjalon
2021-03-15 15:59             ` Stephen Hemminger
2021-03-15 17:01               ` Kinsella, Ray
2021-03-12 18:17   ` [dpdk-dev] [PATCH v3 08/11] app: fix exit messages Thomas Monjalon
2021-03-12 18:17   ` [dpdk-dev] [PATCH v3 09/11] app: hook in EAL usage help Thomas Monjalon
2021-03-12 18:17   ` [dpdk-dev] [PATCH v3 10/11] app/regex: fix usage text Thomas Monjalon
2021-03-12 18:17   ` [dpdk-dev] [PATCH v3 11/11] app/testpmd: " Thomas Monjalon
2021-03-19  8:59     ` Li, Xiaoyun
2021-03-19  9:29       ` Thomas Monjalon
2021-03-15  9:40   ` [dpdk-dev] [PATCH v3 00/11] improve options help Bruce Richardson
2021-03-15 10:47     ` Andrew Rybchenko
2021-03-21 22:31 ` [dpdk-dev] [PATCH v4 " Thomas Monjalon
2021-03-21 22:31   ` [dpdk-dev] [PATCH v4 01/11] eal: explain argv behaviour during init Thomas Monjalon
2021-03-21 22:31   ` [dpdk-dev] [PATCH v4 02/11] eal: improve options usage text Thomas Monjalon
2021-03-21 22:31   ` [dpdk-dev] [PATCH v4 03/11] eal: use macros for help option Thomas Monjalon
2021-03-21 22:31   ` [dpdk-dev] [PATCH v4 04/11] eal: move private log functions Thomas Monjalon
2021-03-21 22:31   ` [dpdk-dev] [PATCH v4 05/11] eal: introduce maximum log level macro Thomas Monjalon
2021-03-21 22:31   ` [dpdk-dev] [PATCH v4 06/11] eal: catch invalid log level number Thomas Monjalon
2021-03-21 22:31   ` [dpdk-dev] [PATCH v4 07/11] eal: add log level help Thomas Monjalon
2021-03-23 13:37     ` David Marchand
2021-03-23 15:10       ` Thomas Monjalon
2021-03-23 18:18         ` David Marchand
2021-03-23 18:41           ` Thomas Monjalon
2021-03-24 13:41             ` David Marchand
2021-03-21 22:31   ` [dpdk-dev] [PATCH v4 08/11] app: fix exit messages Thomas Monjalon
2021-03-21 22:31   ` [dpdk-dev] [PATCH v4 09/11] app: hook in EAL usage help Thomas Monjalon
2021-03-21 22:31   ` [dpdk-dev] [PATCH v4 10/11] app/regex: fix usage text Thomas Monjalon
2021-03-21 22:31   ` [dpdk-dev] [PATCH v4 11/11] app/testpmd: " Thomas Monjalon
2021-03-22  1:45     ` Li, Xiaoyun
2021-03-22  8:27     ` Jens Freimann
2021-03-22  9:05       ` Bing Zhao
2021-03-24 15:03   ` [dpdk-dev] [PATCH v4 00/11] improve options help David Marchand
2021-03-24 16:55     ` Thomas Monjalon
2021-04-05 19:29 ` [dpdk-dev] [PATCH v5 0/4] log level enhancements Thomas Monjalon
2021-04-05 19:29   ` [dpdk-dev] [PATCH v5 1/4] log: move private functions Thomas Monjalon
2021-04-06 11:28     ` David Marchand
2021-04-06 12:08       ` Thomas Monjalon
2021-04-05 19:29   ` [dpdk-dev] [PATCH v5 2/4] log: introduce macro for maximum level Thomas Monjalon
2021-04-05 19:29   ` [dpdk-dev] [PATCH v5 3/4] log: catch invalid level option number Thomas Monjalon
2021-04-05 19:30   ` [dpdk-dev] [PATCH v5 4/4] log: add option argument help Thomas Monjalon
2021-04-06 13:11   ` [dpdk-dev] [PATCH v6 0/4] log level enhancements Thomas Monjalon
2021-04-06 13:11     ` [dpdk-dev] [PATCH v6 1/4] log: move private functions Thomas Monjalon
2021-04-06 13:11     ` [dpdk-dev] [PATCH v6 2/4] log: introduce macro for maximum level Thomas Monjalon
2021-04-06 14:32       ` David Marchand
2021-04-06 13:11     ` [dpdk-dev] [PATCH v6 3/4] log: catch invalid level option number Thomas Monjalon
2021-04-06 14:35       ` David Marchand
2021-04-06 13:11     ` [dpdk-dev] [PATCH v6 4/4] log: add option argument help Thomas Monjalon
2021-04-06 14:28       ` David Marchand
2021-04-06 14:58         ` Thomas Monjalon
2021-04-06 16:04       ` Thomas Monjalon
2021-04-06 16:35         ` David Marchand
2021-04-08 16:47   ` [dpdk-dev] [PATCH v7 0/4] log level enhancements Thomas Monjalon
2021-04-08 16:47     ` [dpdk-dev] [PATCH v7 1/4] log: move private functions Thomas Monjalon
2021-04-08 16:47     ` [dpdk-dev] [PATCH v7 2/4] log: introduce macro for maximum level Thomas Monjalon
2021-04-08 16:47     ` [dpdk-dev] [PATCH v7 3/4] log: catch invalid level option number Thomas Monjalon
2021-04-08 16:47     ` [dpdk-dev] [PATCH v7 4/4] log: add option argument help Thomas Monjalon
2021-04-09  9:31       ` David Marchand
2021-04-13 16:55       ` Kinsella, Ray
2021-04-09 10:55     ` [dpdk-dev] [PATCH v7 0/4] log level enhancements David Marchand
2021-04-05 19:33 ` [dpdk-dev] [PATCH v5 0/3] cleanup exit and usage messages in apps Thomas Monjalon
2021-04-05 19:33   ` [dpdk-dev] [PATCH v5 1/3] app: fix exit messages Thomas Monjalon
2021-04-05 19:33   ` [dpdk-dev] [PATCH v5 2/3] app/regex: fix usage text Thomas Monjalon
2021-04-05 19:33   ` [dpdk-dev] [PATCH v5 3/3] app/testpmd: " Thomas Monjalon
2021-04-09 12:31   ` [dpdk-dev] [PATCH v5 0/3] cleanup exit and usage messages in apps David Marchand
2021-04-05 19:39 ` [dpdk-dev] [PATCH v5 0/4] improve options help Thomas Monjalon
2021-04-05 19:39   ` [dpdk-dev] [PATCH v5 1/4] eal: explain argv behaviour during init Thomas Monjalon
2023-07-05 16:51     ` Stephen Hemminger
2021-04-05 19:39   ` [dpdk-dev] [PATCH v5 2/4] eal: improve options usage text Thomas Monjalon
2023-07-06 18:45     ` Stephen Hemminger
2024-03-18 22:11     ` Stephen Hemminger
2021-04-05 19:39   ` [dpdk-dev] [PATCH v5 3/4] eal: use macros for help option Thomas Monjalon
2023-07-05 16:52     ` Stephen Hemminger
2021-04-05 19:39   ` [dpdk-dev] [PATCH v5 4/4] app: hook in EAL usage help Thomas Monjalon
2021-04-06 13:32     ` Jerin Jacob
2021-04-06 14:05       ` Thomas Monjalon
2021-04-06 14:13         ` Jerin Jacob
2023-06-29 16:27   ` [dpdk-dev] [PATCH v5 0/4] improve options help Stephen Hemminger
2023-07-06  8:29     ` Thomas Monjalon
2023-07-06 14:44       ` Stephen Hemminger
2023-07-06 15:53         ` 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=20210312181720.242252-3-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=dmitrym@microsoft.com \
    --cc=mb@smartsharesystems.com \
    --cc=navasile@linux.microsoft.com \
    --cc=pallavi.kadam@intel.com \
    /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).