0

I have an interactive program written in Go.

How might I go about implementing tab completion within the program?

Would command history be possible (pressing up/down arrow key)?

Example:

$ ./go-program

(Go-Program)> set option <tab tab>

Mike
  • 37
  • 6
  • 3
    This sounds pretty broad. You might look into using readline functionality, for example through [this implementation](https://github.com/chzyer/readline). – Benjamin W. Nov 05 '18 at 20:15
  • 1
    have a look at this: https://github.com/abiosoft/ishell – Not_a_Golfer Nov 05 '18 at 20:24
  • You could wrap the Bash Complete command like here: https://github.com/rwxrob/bonzai/blob/7f457a1b75612018e6e35f21ac73c10caf9c9f49/z/cmd.go .. read more about Complete here: https://askubuntu.com/a/1444201/795299 – alchemy Dec 06 '22 at 02:52

0 Answers0