From: Boris Brezillon Date: Thu, 29 Nov 2018 00:39:15 +0100 Subject: [U-Boot] [PATCH v2 0/6] cmd: Simplify support for sub-commands Message-ID: <20181128233921.16675-1-boris.brezillon@bootlin.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello, Here is the 2nd version of the sub-cmd patchset. This version simplifies the sub-cmd declaration syntax and allows per sub-cmd maxargs and repeatable check. I also added a patch showing how simple it is to convert an existing command to this infrastructure. I converting a bunch of other cmds [1] but I keep that for later, as I don't want to scare reviewers with a 20+ patch series. Regards, Boris [1]https://github.com/bbrezillon/u-boot/commits/sub-cmds Changes since v1: - Drop a few params in the subcmd macro def - Get repeatable and maxargs info from the subcmd instead of the main one - Convert the adc command Boris Brezillon (6): common: command: Fix command auto-completion common: command: Expose a generic helper to auto-complete sub commands common: command: Rework the 'cmd is repeatable' logic command: commands: Add macros to declare commands with subcmds cmd: mtd: Use the subcmd infrastructure to declare mtd sub-commands cmd: adc: Use the sub-command infrastructure cmd/adc.c | 31 +-- cmd/dtimg.c | 2 +- cmd/help.c | 2 +- cmd/mmc.c | 4 +- cmd/mtd.c | 476 +++++++++++++++++++++++++++------------------- common/command.c | 68 ++++++- include/command.h | 133 ++++++++++++- 7 files changed, 476 insertions(+), 240 deletions(-) -- 2.17.1