Closed sukrithanda closed 7 years ago
Liner does not have any way to know which prompts are valid. Feel free to call AppendHistory
with any string that you think will be useful to your users.
"AppendHistory should be called iff Prompt returns a valid command." Any reason for this comment in the docs?
For the programs I have written, invalid commands are noise, and not useful to me. Plus, if I want most of a previous invalid command I can copy-and-paste in the terminal. But then, my command lines tend to be very short, so they're easy to manage. The decision may be different if your program has longer command lines.
thanks! makes sense
Would it be possible to add a configuration to allow invalid and valid prompts to be saved in history? for longer prompts if a typo occurs the user has to retype the entire prompt.