[ditz-talk] bash completion

Christian Garbs mitch at cgarbs.de
Sun Jul 20 06:46:46 EDT 2008


The current ditz bash completion[1] is very simple (it's my first try
at writing a completion).

The first parameter is expanded to the ditz command list (obtained via
the secret parameter `ditz --commands`).
The second parameter is expanded to all open issues (via
`ditz todo 2>/dev/null | grep '^. ' | cut -c 3- | cut -d : -f 1`).

Unfortunately this simplification makes "ditz release" expand to the
open issues and not to the open releases.

I'm working on fixing this and providing proper completions for every
command, but I don't know how to get lists of these items properly:

 - all issues (for 'ditz comment' etc.)
 - all open issues (for 'ditz close')[2]
 - all unstarted issues (for 'start')
 - all started issues ('stop')
 - all assigned issues ('unassign')

 - all releases ('add-release', 'archive', 'changelog', ...)
 - unreleased releases ('release')

 - all components ('set-component')

Would it be possible to add other secret switches like
'ditz --commands' to print these lists of items?


[1] commit cfb08b623811664387829977a927be4921d1439e
[2] I can get this like described above, but a direct output from ditz
    would be faster.

Incorrigible punster -- Do not incorrige.

More information about the ditz-talk mailing list