Re: [PATCH v2 3/3] completion: collapse extra --no-.. options
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- May 29, 2018, 19:04 UTC
- Message-ID
- <CACsJy8Cq8LaFf=fvU02e4aepOUXC8CUTFeiUVHVvzYk50AqmVA@mail.gmail.com>
- In-Reply-To
- <CAGZ79kZ+kDRHKJj917rZ-=mmusuTcB4_Su-BNupqdQqT6rWRaQ@mail.gmail.com>
On Tue, May 29, 2018 at 8:48 PM, Stefan Beller <sbeller@google.com> wrote:
Show 34 quoted lines
> On Sun, May 27, 2018 at 1:38 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote: >> The commands that make use of --git-completion-helper feature could >> now produce a lot of --no-xxx options that a command can take. This in >> many case could nearly double the amount of completable options, using >> more screen estate and also harder to search for the wanted option. >> >> This patch attempts to mitigate that by collapsing extra --no- >> options, the ones that are added by --git-completion-helper and not in >> original struct option arrays. The "--no-..." option will be displayed >> in this case to hint about more options, e.g. >> >> > ~/w/git $ git clone -- >> --bare --origin= >> --branch= --progress >> --checkout --quiet >> --config= --recurse-submodules >> --depth= --reference= >> --dissociate --reference-if-able= >> --filter= --separate-git-dir= >> --hardlinks --shallow-exclude= >> --ipv4 --shallow-since= >> --ipv6 --shallow-submodules >> --jobs= --shared >> --local --single-branch >> --mirror --tags >> --no-... --template= >> --no-checkout --upload-pack= >> --no-hardlinks --verbose >> --no-tags > > https://public-inbox.org/git/20180527083828.6919-1-pclouds@gmail.com/ > " There's no magic numbers (previously we keep 3 --no- options)" > > Here I see 3 no- options, is the number how many no's to show configurable now?
In a sense, yes. If you write OPT_BOOL(0, "no-foo",...) then that --no-foo _always_ shows. "git clone" just happens to have three of them.
-- Duy