mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
new: new clear session command
This commit is contained in:
parent
9f8aa21136
commit
29002eb0b8
1 changed files with 12 additions and 0 deletions
|
@ -7,6 +7,8 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/evilsocket/bettercap-ng/core"
|
||||
|
||||
"github.com/chzyer/readline"
|
||||
)
|
||||
|
||||
func (s *Session) helpHandler(args []string, sess *Session) error {
|
||||
|
@ -145,6 +147,11 @@ func (s *Session) setHandler(args []string, sess *Session) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (s *Session) clsHandler(args []string, sess *Session) error {
|
||||
readline.ClearScreen(s.Input.Stdout())
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Session) registerCoreHandlers() {
|
||||
s.CoreHandlers = append(s.CoreHandlers, NewCommandHandler("help",
|
||||
"^(help|\\?)$",
|
||||
|
@ -180,4 +187,9 @@ func (s *Session) registerCoreHandlers() {
|
|||
"^set\\s+([^\\s]+)\\s+(.+)",
|
||||
"Set the VALUE of variable NAME.",
|
||||
s.setHandler))
|
||||
|
||||
s.CoreHandlers = append(s.CoreHandlers, NewCommandHandler("clear",
|
||||
"^(clear|cls)$",
|
||||
"Clear the screen.",
|
||||
s.clsHandler))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue