#1092049 dgit: provide bash-completion

#1092049#5
Date:
2025-01-04 04:19:10 UTC
From:
To:
Dear Maintainer,

It would be great if dgit supports bash-completion.

I have tried to work on it.  It looks like operations/commands are
implemented as functions, so to get a list of all commands the following
simple grep works:

,----
| egrep "^sub cmd_" dgit | sed -r "s/^sub cmd_(\w+).*$/\1/;s/_/-/g"
`----

However, for options it's more complicated, and in some cases multiple
options are implemented together, so grepping the source code won't work
reliably.

I wonder whether dgit may consider give a little help by providing some
helper functions to list all available operations and options so that
it's easier to implement bash-completion, and also future-proof.