Ticket #364 (closed enhancement: fixed)
Tab completion for athinfo
Reported by: | broder | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | The Distant Future |
Component: | dotfiles | Keywords: | |
Cc: | Fixed in version: | ||
Upstream bug: |
Description
It would be cool to add tab completion to athinfo.
You could use the _known_hosts function for completing the hostname, and then the output of athinfo <hostname> queries for completing the query.
This does have some small challenges. It's possible that the remote host is down, in which case athinfo will hang for some time before timing out; you don't want that hang to hang tab completion as well.
Since all queries (including 'query') are admin-configurable, you can never assume that the output is actually in the right format, or free of undesirable spaces/semicolons/etc.
And you can also never assume that athinfo won't hang after connecting while it's in the process of printing out the query.
To solve the latter two issues, you want to make sure that you kill athinfo after a timeout (probably no more than a second). I'm not sure whether this can be done from pure bash, so you might need a helper script.