google/glaive — pull request #11 by glts (2014-01-11 18:53:40+00:00)
Title: Add basic command-line completion for :Glaive

Here's what this does. On the left before pressing ``, on the right after.

* Complete plugin name:
```
:Glaive _ :Glaive glaive_
helloworld_
maktaba_
```
```
:Glaive mak_ :Glaive maktaba_
```
```
:Glaive maktaba_ :Glaive maktaba_
```

* Complete flag name:
```
:Glaive helloworld _ :Glaive helloworld instant_
name_
plugin_
```
```
:Glaive helloworld na_ :Glaive helloworld name_
```
```
:Glaive helloworld name_ :Glaive helloworld name_
```
```
:Glaive helloworld !plu_ :Glaive helloworld !plugin_
```

* Complete current flag value:
```
:Glaive helloworld name=_ :Glaive helloworld name='world'_
```
```
:Glaive helloworld name-=_ :Glaive helloworld name-='world'_
```
```
:Glaive helloworld plugin=_ :Glaive helloworld plugin={}_
```

What's missing is completion of foci, and other things.

Errors are handled silently, returning no completion candidates (`[]`) instead of letting exceptions bubble up to the user. You mentioned in #9 that you wanted to create an API to query flag values at the same time, I did not do that. I also did not use the settings parser (cursor pos must be taken into account). This here is a simple, superficial solution that works fine for the common case.

Do be blunt (small things & big things), and feel free to reject in part or as a whole.