On Thu, May 09, 2019 at 10:43:06AM +0100, Ian Jackson wrote:
> Colin Watson writes ("Bug#928704: dgit: add bash completion for command-line
> options"):
> > dgit has a number of rather long option names (for example though not
> > limited to the --deliberately-* family). Having to type these out by
> > hand makes me wish for bash completion support, similar to the generally
> > excellent completion provided by git itself, so that I could
> > tab-complete option names.
> >
> > I'm aware that writing shell completion files is sometimes a rather
> > open-ended task, so for the purposes of this bug I'm just requesting
> > completion over options.
>
> This is a fine idea.
>
> However I don't use bash-completion because I personally find it
> annoying, and I have no idea how to do this. I would welcome
> contributions, even in the form of a skeleton or initial version which
> I could keep up to date.
Yes, I'm afraid that while I use it and (with some exceptions) generally
like it, I have never actually rolled up my sleeves and worked out how
to write the things myself, so this would be a learning curve for me
too. It'll go on my to-do list somewhere but quite a long way down, so
if anyone else wants to tackle it then that might be better ...
I believe that in general terms the two strategies are to enumerate all
the possible options separately or to have some way to ask the program
which options it supports. The bash-completion file for git appears to
take the former strategy for the relatively small number of options
supported by the top-level git program, and the latter strategy for git
subcommands (see e.g. "git checkout --git-completion-helper").
Thanks,
--
Colin Watson [[email protected]]