[U-Boot] [PATCH 0/2] cmd: auto-complete args starting with a $

Boris Brezillon boris.brezillon at bootlin.com
Tue Dec 4 13:11:44 UTC 2018


On Tue, 04 Dec 2018 14:00:47 +0100
Wolfgang Denk <wd at denx.de> wrote:

> Dear Boris,
> 
> In message <20181204113313.577178ac at 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
 );


More information about the U-Boot mailing list