mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 5/6] commands: drvinfo: support filtering by driver
Date: Thu, 27 Oct 2022 10:49:41 +0200	[thread overview]
Message-ID: <20221027084941.GU6702@pengutronix.de> (raw)
In-Reply-To: <85fd321f-b525-76a2-1184-39a0ac2f9caa@pengutronix.de>

On Thu, Oct 27, 2022 at 09:51:38AM +0200, Ahmad Fatoum wrote:
> Hi!
> 
> On 27.10.22 09:29, Sascha Hauer wrote:
> > On Wed, Oct 26, 2022 at 08:42:04AM +0200, Ahmad Fatoum wrote:
> >> drvinfo can be very long especially for the in-tree defconfigs,
> >> add optional filtering support:
> >> +	if (IS_ENABLED(CONFIG_AUTO_COMPLETE) && argc > 1)
> >> +		filter = strjoin(" ", &argv[1], argc - 1);
> > 
> > Why does this depend on CONFIG_AUTO_COMPLETE?
> 
> drvinfo is something I think should always be enabled and I didn't want
> to bloat it unconditionally.
> 
> > 
> >> +
> >>  	printf("Driver\tDevice(s)\n");
> >>  	printf("--------------------\n");
> >>  	for_each_driver(drv) {
> >> +		if (filter && !str_has_prefix(drv->name, filter))
> >> +			continue;
> > 
> > I don't see how this is expected to work. When you pass multiple drivers
> > as argument 'filter' will be a concatenation of multiple driver names
> > which then matches nothing.
> 
> Autocomplete doesn't work for elements with spaces, so when you write
> 
>   drvinfo TI<Tab>
> 
> You get
> 
>     drvinfo TI DP83
> 
> with no further ability to complete. The prefix matching can work with that
> and will produce:

Then please fix the tab completion accordingly rather than further work
around this. See the series I just sent.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



  reply	other threads:[~2022-10-27  8:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26  6:42 [PATCH 1/6] commands: add new uptime command Ahmad Fatoum
2022-10-26  6:42 ` [PATCH 2/6] commands: time: refactor into new strjoin Ahmad Fatoum
2022-10-26  6:42 ` [PATCH 3/6] string: reduce strjoin runtime, drop trailing separator Ahmad Fatoum
2022-10-27  6:56   ` Sascha Hauer
2022-10-27  7:24     ` Ahmad Fatoum
2022-10-27  7:33       ` Sascha Hauer
2022-10-27  7:53         ` Ahmad Fatoum
2022-10-26  6:42 ` [PATCH 4/6] test: self: add strjoin tests Ahmad Fatoum
2022-10-26  6:42 ` [PATCH 5/6] commands: drvinfo: support filtering by driver Ahmad Fatoum
2022-10-27  7:29   ` Sascha Hauer
2022-10-27  7:51     ` Ahmad Fatoum
2022-10-27  8:49       ` Sascha Hauer [this message]
2022-10-26  6:42 ` [PATCH 6/6] test: self: only include ramfs selftest when CONFIG_SELFTEST_FS_RAMFS=y Ahmad Fatoum
2022-10-27  7:11 ` [PATCH 1/6] commands: add new uptime command Sascha Hauer

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=20221027084941.GU6702@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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