I wrote more than 2 years ago a bash completion file for git-annex (did I miss an official version?) I just updated it today to match current version of git-annex, it is far from perfect, still incomplete, and probably buggy, but works for me. I tried to attach the file in case it could be useful to someone, but it seems that I can't; is it ok to paste the code directly?
This code needs the bash-completion file for git by Shawn O. Pearce, I think it is distributed by default on debian. Any feed-back or improvement is welcome! I'm far from expert, use at your own risks.
I've recently added built-in bash completion to git-annex, enabled by the
bash-completion.bash
file. It knows about all sub-commands, and all options, and will automatically always be up-to-date with the argument parser!Currently, it only works for completing "git-annex", not "git annex". I have submitted a patch to git's bash completion to make the latter work.
bash-completion.bash
file is not included in the standalone Linux tarball. Could it be added? It would be helpful at least for the Arch package in the AUR that is based on the tarball.It's not included in the standalone tarball because it wouldn't be installed in a usable location if it were included.
I continue to think that the git-annex-bin package in Arch is not a good choice. I get more complaints about problems with that package than any other distribution package of git-annex. Complicating the tarball to support that further is not appealing.