go-prompt
go-prompt copied to clipboard
History Get function added
Added a history.Get function to return x lines back in the history as a string slice. I find this func useful for dealing with history in the command shell. I was looping through older/newer before adding this and it simplified things a lot for me. Added a test to make sure it's working as expected.
Thanks. I left a few comments.
Hello, added a test with the panic case from above and fixed the error. I also updated the function naming here a bit so it's less likely to hit a future conflict. Changed function Get to GetLines, added a GetLine and GetLast to go with it and tests for them as well.