Fuppes, Interesting

Bash-Completion: Fuppes and more

Very recently I have started writing a few bash completion scripts for myself. The first one I wrote was for the Ubuntu ‘powermanagement-interface’ package that allowed the binary pmi to autocomplete. And then I tried my hands of Fuppes for autocompletion and it turned out to be really easy. When the fuppes package comes out then it will ship with autocompletion for every option bar one. And that is where things start to get interesting. You may be wondering ‘Well why is there one command left that does not get autocompleted?’ Why not just finish it off? The reason is because I am dealing with the second half of the following option:

--friendly-name 

So the question is: how do you autocomplete or offer suggestions for a name? The first idea that popped into my mind was to create some sort of ‘username-computer’ by permuting ‘compgen -u’ and ‘compgen -A hostname’. That would work but I don’t like the thought of lots of permutations and that sort of code could easily become problematic.

At the same time I could just try a markov chain generator for the lolz. Keep pressing tab and generate your own random server name; yeah I can see that having some fun results. But is it actually useful; which is the whole point of bash completion?

I guess that there are many interesting things that you could do with the bash autocompletion and I’ve only just touched on some of them. I’m going to continue to speculate on what funny or cool things i could add in that space. If you have any interesting ways in which I could generate cool names for bash completion then please give me a comment about it.

Leave a comment