From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Nandini Persad <nandinipersad361@gmail.com>
Subject: [PATCH v3 08/11] doc: correct errors in command-line library guide
Date: Tue, 13 Jan 2026 14:51:10 -0800 [thread overview]
Message-ID: <20260113230052.54435-9-stephen@networkplumber.org> (raw)
In-Reply-To: <20260113230052.54435-1-stephen@networkplumber.org>
Fix several errors in the cmdline library documentation:
- Fix function name typo: cmdline_new_stdin -> cmdline_stdin_new
- Fix type name: cmdline_parse_t -> cmdline_parse_inst_t
- Fix grammar: "that others" -> "than others"
- Fix spelling: "boiler plate" -> "boilerplate"
- Clarify wording: "multiplex" -> "direct" for command routing
- Fix misleading phrase: "call a separate function" -> "call a single
function" (multiplexing routes multiple commands to one callback)
Signed-off-by: Nandini Persad <nandinipersad361@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
doc/guides/prog_guide/cmdline.rst | 42 +++++++++++++++----------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/doc/guides/prog_guide/cmdline.rst b/doc/guides/prog_guide/cmdline.rst
index e20281ceb5..c794ec826f 100644
--- a/doc/guides/prog_guide/cmdline.rst
+++ b/doc/guides/prog_guide/cmdline.rst
@@ -4,9 +4,9 @@
Command-line Library
====================
-Since its earliest versions, DPDK has included a command-line library -
-primarily for internal use by, for example, ``dpdk-testpmd`` and the ``dpdk-test`` binaries,
-but the library is also exported on install and can be used by any end application.
+Since its earliest versions, DPDK has included a command-line library,
+primarily for internal use by, for example, ``dpdk-testpmd`` and the ``dpdk-test`` binaries.
+However, the library is also exported on install and can be used by any end application.
This chapter covers the basics of the command-line library and how to use it in an application.
Library Features
@@ -18,14 +18,14 @@ The DPDK command-line library supports the following features:
* Ability to read and process commands taken from an input file, e.g. startup script
-* Parameterized commands able to take multiple parameters with different datatypes:
+* Parameterized commands that can take multiple parameters with different datatypes:
* Strings
* Signed/unsigned 16/32/64-bit integers
* IP Addresses
* Ethernet Addresses
-* Ability to multiplex multiple commands to a single callback function
+* Ability to direct multiple commands to a single callback function
Adding Command-line to an Application
-------------------------------------
@@ -46,7 +46,7 @@ Adding a command-line instance to an application involves a number of coding ste
Many of these steps can be automated using the script ``dpdk-cmdline-gen.py`` installed by DPDK,
and found in the ``buildtools`` folder in the source tree.
-This section covers adding a command-line using this script to generate the boiler plate,
+This section covers adding a command-line using this script to generate the boilerplate,
while the following section,
`Worked Example of Adding Command-line to an Application`_ covers the steps to do so manually.
@@ -56,7 +56,7 @@ Creating a Command List File
The ``dpdk-cmdline-gen.py`` script takes as input a list of commands to be used by the application.
While these can be piped to it via standard input, using a list file is probably best.
-The format of the list file must be:
+The format of the list file must follow these requirements:
* Comment lines start with '#' as first non-whitespace character
@@ -75,7 +75,7 @@ The format of the list file must be:
* ``<IPv6>dst_ip6``
* Variable fields, which take their values from a list of options,
- have the comma-separated option list placed in braces, rather than a the type name.
+ have the comma-separated option list placed in braces, rather than by the type name.
For example,
* ``<(rx,tx,rxtx)>mode``
@@ -127,13 +127,13 @@ and the callback stubs will be written to an equivalent ".c" file.
Providing the Function Callbacks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-As discussed above, the script output is a header file, containing structure definitions,
-but the callback functions themselves obviously have to be provided by the user.
-These callback functions must be provided as non-static functions in a C file,
+As discussed above, the script output is a header file containing structure definitions,
+but the callback functions must be provided by the user.
+These callback functions must be provided as non-static functions in a C file
and named ``cmd_<cmdname>_parsed``.
The function prototypes can be seen in the generated output header.
-The "cmdname" part of the function name is built up by combining the non-variable initial tokens in the command.
+The "cmdname" part of the function name is built by combining the non-variable initial tokens in the command.
So, given the commands in our worked example below: ``quit`` and ``show port stats <n>``,
the callback functions would be:
@@ -151,11 +151,11 @@ the callback functions would be:
...
}
-These functions must be provided by the developer, but, as stated above,
+These functions must be provided by the developer. However, as stated above,
stub functions may be generated by the script automatically using the ``--stubs`` parameter.
The same "cmdname" stem is used in the naming of the generated structures too.
-To get at the results structure for each command above,
+To get to the results structure for each command above,
the ``parsed_result`` parameter should be cast to ``struct cmd_quit_result``
or ``struct cmd_show_port_stats_result`` respectively.
@@ -179,7 +179,7 @@ To integrate the script output with the application,
we must ``#include`` the generated header into our applications C file,
and then have the command-line created via either ``cmdline_new`` or ``cmdline_stdin_new``.
The first parameter to the function call should be the context array in the generated header file,
-``ctx`` by default. (Modifiable via script parameter).
+``ctx`` by default (Modifiable via script parameter).
The callback functions may be in this same file, or in a separate one -
they just need to be available to the linker at build-time.
@@ -190,7 +190,7 @@ Limitations of the Script Approach
The script approach works for most commands that a user may wish to add to an application.
However, it does not support the full range of functions possible with the DPDK command-line library.
For example,
-it is not possible using the script to multiplex multiple commands into a single callback function.
+it is not possible using the script to direct multiple commands to a single callback function.
To use this functionality, the user should follow the instructions in the next section
`Worked Example of Adding Command-line to an Application`_ to manually configure a command-line instance.
@@ -416,7 +416,7 @@ Once we have our ``ctx`` variable defined,
we now just need to call the API to create the new command-line instance in our application.
The basic API is ``cmdline_new`` which will create an interactive command-line with all commands available.
However, if additional features for interactive use - such as tab-completion -
-are desired, it is recommended that ``cmdline_new_stdin`` be used instead.
+are desired, it is recommended that ``cmdline_stdin_new`` be used instead.
A pattern that can be used in applications is to use ``cmdline_new`` for processing any startup commands,
either from file or from the environment (as is done in the "dpdk-test" application),
@@ -449,8 +449,8 @@ For example, to handle a startup file and then provide an interactive prompt:
Multiplexing Multiple Commands to a Single Function
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-To reduce the amount of boiler-plate code needed when creating a command-line for an application,
-it is possible to merge a number of commands together to have them call a separate function.
+To reduce the amount of boilerplate code needed when creating a command-line for an application,
+it is possible to merge a number of commands together to have them call a single function.
This can be done in a number of different ways:
* A callback function can be used as the target for a number of different commands.
@@ -463,7 +463,7 @@ This can be done in a number of different ways:
As a concrete example,
these two techniques are used in the DPDK unit test application ``dpdk-test``,
-where a single command ``cmdline_parse_t`` instance is used for all the "dump_<item>" test cases.
+where a single ``cmdline_parse_inst_t`` instance is used for all the "dump_<item>" test cases.
.. literalinclude:: ../../../app/test/commands.c
:language: c
@@ -481,7 +481,7 @@ the following DPDK files can be consulted for examples of command-line use.
This is not an exhaustive list of examples of command-line use in DPDK.
It is simply a list of a few files that may be of use to the application developer.
- Some of these referenced files contain more complex examples of use that others.
+ Some of these referenced files contain more complex examples of use than others.
* ``commands.c/.h`` in ``examples/cmdline``
--
2.51.0
next prev parent reply other threads:[~2026-01-13 23:01 UTC|newest]
Thread overview: 118+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-13 15:59 [PATCH 0/9] reowrd in prog guide Nandini Persad
2024-05-13 15:59 ` [PATCH 1/9] doc: reword design section in contributors guidelines Nandini Persad
2024-05-13 15:59 ` [PATCH 2/9] doc: reword pmd section in prog guide Nandini Persad
2024-05-13 15:59 ` [PATCH 3/9] doc: reword argparse " Nandini Persad
2024-05-13 19:01 ` Stephen Hemminger
2024-05-13 15:59 ` [PATCH 4/9] doc: reword service cores " Nandini Persad
2024-05-13 15:59 ` [PATCH 5/9] doc: reword trace library " Nandini Persad
2024-05-13 15:59 ` [PATCH 6/9] doc: reword log " Nandini Persad
2024-05-13 15:59 ` [PATCH 7/9] doc: reword cmdline " Nandini Persad
2024-05-13 15:59 ` [PATCH 8/9] doc: reword stack library " Nandini Persad
2024-05-13 15:59 ` [PATCH 9/9] doc: reword rcu " Nandini Persad
2024-06-21 2:32 ` [PATCH v2 1/9] doc: reword pmd " Nandini Persad
2024-06-21 2:32 ` [PATCH v2 2/9] doc: reword argparse " Nandini Persad
2024-06-22 14:53 ` Stephen Hemminger
2026-03-30 16:08 ` Stephen Hemminger
2024-06-21 2:32 ` [PATCH v2 3/9] doc: reword design section in contributors guidelines Nandini Persad
2024-06-22 14:47 ` [PATCH] doc/design: minor cleanus Stephen Hemminger
2024-06-24 15:07 ` Thomas Monjalon
2026-03-31 22:53 ` [PATCH v2 3/9] doc: reword design section in contributors guidelines Stephen Hemminger
2024-06-21 2:32 ` [PATCH v2 4/9] doc: reword service cores section in prog guide Nandini Persad
2024-06-22 14:53 ` Stephen Hemminger
2026-03-31 22:50 ` Stephen Hemminger
2024-06-21 2:32 ` [PATCH v2 5/9] doc: reword trace library " Nandini Persad
2024-06-22 14:54 ` Stephen Hemminger
2026-03-31 22:49 ` Stephen Hemminger
2024-06-21 2:32 ` [PATCH v2 6/9] doc: reword log " Nandini Persad
2024-06-22 14:55 ` Stephen Hemminger
2026-03-31 22:47 ` Stephen Hemminger
2024-06-21 2:32 ` [PATCH v2 7/9] doc: reword cmdline " Nandini Persad
2024-06-22 14:55 ` Stephen Hemminger
2026-03-31 22:45 ` Stephen Hemminger
2024-06-21 2:32 ` [PATCH v2 8/9] doc: reword stack library " Nandini Persad
2024-06-22 14:55 ` Stephen Hemminger
2026-03-31 22:36 ` Stephen Hemminger
2024-06-21 2:32 ` [PATCH v2 9/9] doc: reword rcu " Nandini Persad
2024-06-22 14:55 ` Stephen Hemminger
2026-03-31 22:35 ` Stephen Hemminger
2024-06-22 14:52 ` [PATCH v2 1/9] doc: reword pmd " Stephen Hemminger
2026-01-13 22:51 ` [PATCH v3 00/11] doc: programmers guide corrections Stephen Hemminger
2026-01-13 22:51 ` [PATCH v3 01/11] doc: correct grammar and punctuation errors in ethdev guide Stephen Hemminger
2026-01-13 22:51 ` [PATCH v3 02/11] doc: correct grammar and typos in argparse library guide Stephen Hemminger
2026-01-13 22:51 ` [PATCH v3 03/11] doc: correct grammar and typos in design guide Stephen Hemminger
2026-01-13 22:51 ` [PATCH v3 04/11] doc: correct errors in Linux system requirements guide Stephen Hemminger
2026-01-13 22:51 ` [PATCH v3 05/11] doc: correct grammar in service cores guide Stephen Hemminger
2026-01-13 22:51 ` [PATCH v3 06/11] doc: correct grammar and errors in trace library guide Stephen Hemminger
2026-01-13 22:51 ` [PATCH v3 07/11] doc: correct typos in log " Stephen Hemminger
2026-01-13 22:51 ` Stephen Hemminger [this message]
2026-01-13 22:51 ` [PATCH v3 09/11] doc: correct errors in trace " Stephen Hemminger
2026-01-13 22:51 ` [PATCH v3 10/11] doc: correct errors in stack " Stephen Hemminger
2026-01-13 22:51 ` [PATCH v3 11/11] doc: correct errors in RCU " Stephen Hemminger
2026-01-14 22:26 ` [PATCH v4 00/11] doc: programmers guide corrections Stephen Hemminger
2026-01-14 22:26 ` [PATCH v4 01/11] doc: correct grammar and punctuation errors in ethdev guide Stephen Hemminger
2026-01-14 22:26 ` [PATCH v4 02/11] doc: correct grammar and typos in argparse library guide Stephen Hemminger
2026-01-19 0:50 ` fengchengwen
2026-01-14 22:26 ` [PATCH v4 03/11] doc: correct grammar and typos in design guide Stephen Hemminger
2026-01-14 22:26 ` [PATCH v4 04/11] doc: correct errors in Linux system requirements guide Stephen Hemminger
2026-01-14 22:26 ` [PATCH v4 05/11] doc: correct grammar in service cores guide Stephen Hemminger
2026-01-14 22:26 ` [PATCH v4 06/11] doc: correct grammar and errors in trace library guide Stephen Hemminger
2026-01-14 22:26 ` [PATCH v4 07/11] doc: correct typos in log " Stephen Hemminger
2026-01-14 22:27 ` [PATCH v4 08/11] doc: correct errors in command-line " Stephen Hemminger
2026-01-14 22:27 ` [PATCH v4 09/11] doc: correct errors in trace " Stephen Hemminger
2026-01-14 22:27 ` [PATCH v4 10/11] doc: correct errors in stack " Stephen Hemminger
2026-01-14 22:27 ` [PATCH v4 11/11] doc: correct errors in RCU " Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 00/54] doc: programmers guide corrections Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 01/54] doc: correct grammar and typos in argparse library guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 02/54] doc: correct grammar in service cores guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 03/54] doc: correct grammar and errors in trace library guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 04/54] doc: correct typos in log " Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 05/54] doc: correct errors in command-line " Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 06/54] doc: correct errors in trace " Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 07/54] doc: correct errors in stack " Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 08/54] doc: correct errors in RCU " Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 09/54] doc: correct grammar and formatting in ASan guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 10/54] doc: correct grammar and typos in bbdev guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 11/54] doc: correct grammar and formatting in bpf lib guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 12/54] doc: correct grammar and typos in meson build guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 13/54] doc: correct grammar and typos in cryptodev guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 14/54] doc: correct grammar and formatting in compressdev guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 15/54] doc: correct grammar in dmadev guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 16/54] doc: correct grammar in efd guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 17/54] doc: correct grammar in EAL guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 18/54] doc: correct double space in FIB guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 19/54] doc: correct grammar in GRO guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 20/54] doc: correct grammar in GSO guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 21/54] doc: correct typos and grammar in graph guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 22/54] doc: correct grammar in hash guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 23/54] doc: correct grammar and typos in IP fragment guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 24/54] doc: correct double spaces in IPsec guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 25/54] doc: correct grammar in lcore variables guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 26/54] doc: correct typo in link bonding guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 27/54] doc: correct grammar in LTO guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 28/54] doc: correct grammar in LPM guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 29/54] doc: correct grammar and typo in LPM6 guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 30/54] doc: correct grammar in introduction Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 31/54] doc: correct grammar in mbuf library guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 32/54] doc: correct grammar in membership " Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 33/54] doc: correct errors in mempool " Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 34/54] doc: correct style in meson unit tests guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 35/54] doc: correct errors in metrics library guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 36/54] doc: correct grammar in mldev " Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 37/54] doc: correct grammar in multi-process guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 38/54] doc: correct grammar in overview Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 39/54] doc: correct grammar in ACL library guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 40/54] doc: correct typos in packet distributor guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 41/54] doc: correct grammar in packet framework guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 42/54] doc: correct grammar in PDCP library guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 43/54] doc: correct grammar in pdump " Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 44/54] doc: correct typos in power management guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 45/54] doc: correct grammar in profiling guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 46/54] doc: correct errors in regexdev guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 47/54] doc: correct grammar in reorder library guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 48/54] doc: correct whitespace in RIB " Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 49/54] doc: correct incomplete sentence in ring " Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 50/54] doc: correct grammar in security " Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 51/54] doc: correct hyphenation in thread safety guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 52/54] doc: correct errors in toeplitz hash library guide Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 53/54] doc: correct errors in vhost " Stephen Hemminger
2026-01-18 19:10 ` [PATCH v5 54/54] doc: correct whitespace in efficient code guide Stephen Hemminger
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=20260113230052.54435-9-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=nandinipersad361@gmail.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