One place where I find tab completion quite useful is in things like the program
known as doctl, which interfaces to the DigitalOcean API, which I use to control
DNS for my website domains. This saves me a little time in most cases, as I
don't have to log into the website and find the necessary links, buttons and
controls to change a dns record. These days, I do this rather infrequently, so
going to the website is probably fine, but I still tend to use the doctl command
when I need to make a small change here or there, especially if I need to add a
temporary TXT record that I will be deleting in a short time.
This doctl program has a completion command that generates tab completions for
various shells. So even before I authorized doctl to connect to my account for
the first time, I just ran
doctl completion bash >> ~/.bashrc
and I get tab completions for all the commands and flags available on the doctl
command line. So for example, if I want to update an existing record, I would
normally need to run this command
doctl compute domain records update --record-id 123456789 --record-data 12.34.56.78
But with the completions in place, all I need to run is
doctl c <tab> do <tab> r <tab> u <tab> --r <tab> i <tab> 123456789 --r <tab> d
<tab> 12.34.56.78
Yes, I still have to get this record ID, which is in fact a 9-digit number in
many cases, but I can pipe
doctl c <tab> do <tab> r <tab> ls domain.ext
into a file and paste the ID I want into the update command. It is certainly a
roundabout way of doing things, but it can still be faster than logging into the
website and finding the DNS controls there. It would be really good to have a
zenity or yad interface to this program, and maybe I'll get around to scripting
something like this at some point. For now though, tab completion works quite
well here once the completion mappings are added, even if I'm just copying the
doctl configuration from one machine to another so tha I don't have to
reauthorize the program.
~Kyle
_______________________________________________
Blinux-list mailing list
Blinux-list@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/blinux-list