Add the "-l" parameter to the "env select" command to print the available environment targets, convert all argument parsing in the file nvedit.c to getopt() and check that with unit tests.
The first patch converts the parsing of arguments to getopt() for all env commands. The second one adds unit tests for checking the env command. These were used to check the env commands before and after the conversion. The third patch adds the actual new parameter "-l" for the "env select" command. Christoph Niedermaier (3): cmd: nvedit: Convert the parsing of arguments to getopt() test: cmd: nvedit: Add basic unit tests cmd: env: select: Add output for available environment targets cmd/nvedit.c | 353 +++++++++---------- env/Kconfig | 1 + env/env.c | 16 + include/env.h | 7 + test/cmd/Makefile | 1 + test/cmd/nvedit.c | 844 ++++++++++++++++++++++++++++++++++++++++++++++ test/cmd_ut.c | 2 + 7 files changed, 1051 insertions(+), 173 deletions(-) create mode 100644 test/cmd/nvedit.c Signed-off-by: Christoph Niedermaier <cniederma...@dh-electronics.com> --- Cc: Andy Shevchenko <andriy.shevche...@linux.intel.com> Cc: Christian Marangi <ansuels...@gmail.com> Cc: Heinrich Schuchardt <xypron.g...@gmx.de> Cc: Ilias Apalodimas <ilias.apalodi...@linaro.org> Cc: Jerome Forissier <jerome.foriss...@linaro.org> Cc: Joe Hershberger <joe.hershber...@ni.com> Cc: Marek Vasut <ma...@denx.de> Cc: Michal Simek <michal.si...@amd.com> Cc: Patrick Delaunay <patrick.delau...@foss.st.com> Cc: Rasmus Villemoes <r...@prevas.dk> Cc: Simon Glass <s...@chromium.org> Cc: Tom Rini <tr...@konsulko.com> Cc: Venkatesh Yadav Abbarapu <venkatesh.abbar...@amd.com> -- 2.30.2