Skip to content

cmd: auto-complete args starting with a $

Boris Brezillon u-boot 1 version New

Get series with b4
b4 am 20181204141144.1b1ee051@bbrezillon

Versions newest first

  1. v1 Latest0 of 2 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 2 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [U-Boot] [PATCH 0/2] cmd: auto-complete args starting with a $
Quoted 9 lines · On Tue, 04 Dec 2018 14:00:47 +0100 Wolfgang Denk <[email protected]> wrote:

Dear Boris,

Quoted 5 lines · In message <20181204113313.577178ac@bbrezillon> you wrote:
Quoted 3 lines

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.

Quoted 8 lines

OK, then I misread the patches.

Quoted 3 lines

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---

cmd/echo.c +3 -2
index 5b018d9349ab..857f268c6a61 100644
@@ -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
 );