aboutsummaryrefslogtreecommitdiffstats
path: root/console/prompter.go
diff options
context:
space:
mode:
Diffstat (limited to 'console/prompter.go')
-rw-r--r--console/prompter.go8
1 files changed, 8 insertions, 0 deletions
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) {