Re: [PATCH v2 3/3] completion: collapse extra --no-.. options
From: Duy Nguyen <hidden>
Date: 2018-05-29 19:05:12
On Tue, May 29, 2018 at 8:48 PM, Stefan Beller [off-list ref] wrote:
On Sun, May 27, 2018 at 1:38 AM, Nguyễn Thái Ngọc Duy [off-list ref] wrote:quoted
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-tagshttps://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