Hi, all!
Readline is pure go library that provides line-editing and history capability for interactive users with a command-line interface. It works well in OSX/Linux/Windows.
It supports:
This is very neat, although I’ve yet to look at the full details. There are a few similar things out there, but most were lacking in one way or another when I was last trying to use one to build an interactive-shell like experience. For the record, the things that annoyed me then was getting the combination of:
Customizable history. I.e. some commands I may not want to add to history, duplicates are sometimes useful sometimes not, etc so this really needs to be handled by the application and not decided fully by the readline package.
Customizable word for word tab completion. I needed to be able to support completing commands with subcommands, so not just a “line” but word for word. Ideally with placeholder support, although this can be handled by the application if the completer gets to see all keystrokes. x/crypto/ssh/terminal gets this mostly right.