[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] bash: add completions
From: |
Ville Skyttä |
Subject: |
Re: [PATCH] bash: add completions |
Date: |
Sun, 23 Jul 2023 10:01:34 +0300 |
On Sat, 22 Jul 2023 at 22:55, Ville Skyttä <ville.skytta@iki.fi> wrote:
[...]
> diff --git a/dmidecode.bash b/dmidecode.bash
[...]
> + -s | --string)
> + COMPREPLY=($(compgen -W '
> + bios-vendor
> + bios-version
[...]
Instead of duplicating the keywords here, these could be scraped from
`dmidecode --string` (without providing the keyword arg) output if
that sounds acceptable and the output is considered stable enough for
that purpose. Or let's say `--string help` could be implemented, and
it could print to stdout (no error), and only the keywords with no
error messages or header lines or the like if stdout is not a tty.
Anyway, as it stands, with no modifications, could take all output
lines starting with whitespace from stderr. Ditto other keyword/type
lists across these completions.