Ticket #364 (closed enhancement: fixed)

Opened 12 years ago

Last modified 11 years ago

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.

Attachments

bash_completion Download (392 bytes) - added by broder 12 years ago.

Change History

Changed 12 years ago by broder

comment:1 Changed 11 years ago by broder

  • Status changed from new to closed
  • Resolution set to fixed

Huh. This was fixed when I flipped out and rewrite athinfo in Python. Not sure why the bug didn't get closed, but this was moved to production on April 6th.

Note: See TracTickets for help on using tickets.