go-prompt icon indicating copy to clipboard operation
go-prompt copied to clipboard

History Get function added

Open iepathos opened this issue 7 years ago • 2 comments

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.

iepathos avatar Jun 24 '18 19:06 iepathos

Thanks. I left a few comments.

c-bata avatar Jun 25 '18 02:06 c-bata

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.

iepathos avatar Aug 13 '18 01:08 iepathos