console: add admin.clearHistory command (#15614)

This commit is contained in:
Sorin Neacsu
2017-12-08 06:14:14 -08:00
committed by Felix Lange
parent d95962cd5d
commit 586198ccea
3 changed files with 20 additions and 0 deletions

View File

@ -51,6 +51,9 @@ type UserPrompter interface {
// if and only if the prompt to append was a valid command.
AppendHistory(command string)
// ClearHistory clears the entire history
ClearHistory()
// SetWordCompleter sets the completion function that the prompter will call to
// fetch completion candidates when the user presses tab.
SetWordCompleter(completer WordCompleter)
@ -158,6 +161,11 @@ func (p *terminalPrompter) AppendHistory(command string) {
p.State.AppendHistory(command)
}
// ClearHistory clears the entire history
func (p *terminalPrompter) ClearHistory() {
p.State.ClearHistory()
}
// SetWordCompleter sets the completion function that the prompter will call to
// fetch completion candidates when the user presses tab.
func (p *terminalPrompter) SetWordCompleter(completer WordCompleter) {