Re: latest stg/git commandline completions code
From: Catalin Marinas <hidden>
Date: 2016-06-15 22:42:09
On 25/10/05, Blaisorblade [off-list ref] wrote:
The best idea seems to write a Python script sourcing the Stgit source (stgit/main.py to get commands, and then loading each class and iterating over the "options" module member).
I can add a function in stgit/main.py which would list the options. The tla-completion generates a file listing a command with its option on every line: push -a -all -n --number -t --to --reverse --undo -h --help ... Since I don't know much about the bash completion, let me know of the format you'd prefer.
Btw, what do you think about speeding up completions by reimplementing things like "stg applied" or "stg unapplied" via cat (as noted in the comments at the beginning of the script)? Tab completions can easily livelock a shell on a busy system, so it's worthy speeding the thing up.
In general, it is better to use the stg commands but the repository structure won't probably change for a long time and it's OK to optimise (if the speed improvement is visible). Anyway, these particular commands are pretty fast (they behave like cat) but there are others which are slower (usually the commands involving calls to the GIT tool). -- Catalin