From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Brezillon Date: Tue, 4 Dec 2018 14:11:44 +0100 Subject: [U-Boot] [PATCH 0/2] cmd: auto-complete args starting with a $ In-Reply-To: <20181204130047.D5719242267@gemini.denx.de> References: <20181203220726.19370-1-boris.brezillon@bootlin.com> <20181204094419.6907C242267@gemini.denx.de> <20181204105448.63b9af8c@bbrezillon> <20181204101431.854D4242267@gemini.denx.de> <20181204113313.577178ac@bbrezillon> <20181204130047.D5719242267@gemini.denx.de> Message-ID: <20181204141144.1b1ee051@bbrezillon> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, 04 Dec 2018 14:00:47 +0100 Wolfgang Denk wrote: > Dear Boris, > > In message <20181204113313.577178ac@bbrezillon> you wrote: > > > > > But is this not based on the code of mtd_name_complete() which is > > > only availabole when MTD is present? > > > > Nope. See patch 1, the code is completely independent from the mtd cmd. > > OK, then I misread the patches. > > > Apart from the "make that available to everyone" comment, is there > > anything else you think should be changed? IOW, what is not compliant > > with a standard shell auto-completion in my proposal? > > I can't say easily from the code. I'd have to see this running (in > the sandbox, for example). Actually, that's how I tested it. You can easily test it with the echo command after applying patch 1 of this series + the following diff. --->8--- diff --git a/cmd/echo.c b/cmd/echo.c index 5b018d9349ab..857f268c6a61 100644 --- a/cmd/echo.c +++ b/cmd/echo.c @@ -47,9 +47,10 @@ static int do_echo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 0; } -U_BOOT_CMD( +U_BOOT_CMD_COMPLETE( echo, CONFIG_SYS_MAXARGS, 1, do_echo, "echo args to console", "[args..]\n" - " - echo args to console; \\c suppresses newline" + " - echo args to console; \\c suppresses newline", + dollar_complete );