aboutsummaryrefslogtreecommitdiffstats
path: root/console/prompter.go
diff options
context:
space:
mode:
authorSorin Neacsu <sorin@users.noreply.github.com>2017-12-08 22:14:14 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-12-08 22:14:14 +0800
commit586198cceaf51435121b7e1166adf21910fee51a (patch)
tree92f7184113c18c904b19f15853b4f4a68161d1bf /console/prompter.go
parentd95962cd5d3ea163f8e91d7a9ca2f6303799b2e2 (diff)
downloaddexon-586198cceaf51435121b7e1166adf21910fee51a.tar.gz
dexon-586198cceaf51435121b7e1166adf21910fee51a.tar.zst
dexon-586198cceaf51435121b7e1166adf21910fee51a.zip
console: add admin.clearHistory command (#15614)
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) {