From 586198cceaf51435121b7e1166adf21910fee51a Mon Sep 17 00:00:00 2001 From: Sorin Neacsu Date: Fri, 8 Dec 2017 06:14:14 -0800 Subject: console: add admin.clearHistory command (#15614) --- console/prompter.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'console/prompter.go') diff --git a/console/prompter.go b/console/prompter.go index 6acbfb0e2..ea03694d4 100644 --- a/console/prompter.go +++ b/console/prompter.go @@ -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) { -- cgit