From: Duy Nguyen Date: Fri, 23 Feb 2018 10:59:40 GMT Subject: Re: [PATCH v3 29/42] completion: use __gitcomp_builtin in _git_notes Message-ID: In-Reply-To: On Fri, Feb 23, 2018 at 5:33 PM, Duy Nguyen wrote: > On Wed, Feb 14, 2018 at 9:29 PM, SZEDER Gábor wrote: >> And we could even go one step further: >> >> *,--*) >> __gitcomp_builtin notes_$subcommand >> ;; >> >> This would have the benefit that if any of the remaining subcommands >> learn --options, then they would be completed right away, without the >> need to add that subcommand to the case arms. > > You read my mind ;-) We won't do this in this series though (but I > will simplify the code as suggested). parse-options.c does not have > any concept about these subcommands. So a bit more work and can (and > will) be done separately. Actually I misread you. This is not about completing subcommands but subcommand's options, so it should work nicely. As long as we make sure we handle error cases correctly (e.g. the user try to complete options of a non-existing subcommand) -- Duy