public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 0/2] cmd: auto-complete args starting with a $
Date: Tue, 4 Dec 2018 14:11:44 +0100	[thread overview]
Message-ID: <20181204141144.1b1ee051@bbrezillon> (raw)
In-Reply-To: <20181204130047.D5719242267@gemini.denx.de>

On Tue, 04 Dec 2018 14:00:47 +0100
Wolfgang Denk <wd@denx.de> 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
 );

  reply	other threads:[~2018-12-04 13:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03 22:07 [U-Boot] [PATCH 0/2] cmd: auto-complete args starting with a $ Boris Brezillon
2018-12-03 22:07 ` [U-Boot] [PATCH 1/2] common: command: Provide a dollar_complete() helper Boris Brezillon
2018-12-03 22:07 ` [U-Boot] [PATCH 2/2] cmd: mtd: auto-complete args starting with a $ when appropriate Boris Brezillon
2018-12-04  9:44 ` [U-Boot] [PATCH 0/2] cmd: auto-complete args starting with a $ Wolfgang Denk
2018-12-04  9:54   ` Boris Brezillon
2018-12-04 10:14     ` Wolfgang Denk
2018-12-04 10:33       ` Boris Brezillon
2018-12-04 13:00         ` Wolfgang Denk
2018-12-04 13:11           ` Boris Brezillon [this message]
2018-12-04 13:54         ` Boris Brezillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181204141144.1b1ee051@bbrezillon \
    --to=boris.brezillon@bootlin.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox