mirror of
https://github.com/bettercap/bettercap
synced 2025-07-30 11:40:33 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
d070445225
commit
058a6865ff
5 changed files with 50 additions and 36 deletions
|
@ -15,24 +15,7 @@ const (
|
|||
)
|
||||
|
||||
var (
|
||||
// these are here because if colors are disabled,
|
||||
// we need the updated tui.* variables
|
||||
effects = map[string]string{
|
||||
"{bold}": tui.BOLD,
|
||||
"{dim}": tui.DIM,
|
||||
"{r}": tui.RED,
|
||||
"{g}": tui.GREEN,
|
||||
"{b}": tui.BLUE,
|
||||
"{y}": tui.YELLOW,
|
||||
"{fb}": tui.FOREBLACK,
|
||||
"{fw}": tui.FOREWHITE,
|
||||
"{bdg}": tui.BACKDARKGRAY,
|
||||
"{br}": tui.BACKRED,
|
||||
"{bg}": tui.BACKGREEN,
|
||||
"{by}": tui.BACKYELLOW,
|
||||
"{blb}": tui.BACKLIGHTBLUE, // Ziggy this is for you <3
|
||||
"{reset}": tui.RESET,
|
||||
}
|
||||
effects = map[string]string{}
|
||||
PromptCallbacks = map[string]func(s *Session) string{
|
||||
"{cidr}": func(s *Session) string {
|
||||
return s.Interface.CIDR()
|
||||
|
@ -62,6 +45,24 @@ type Prompt struct {
|
|||
}
|
||||
|
||||
func NewPrompt() Prompt {
|
||||
// these are here because if colors are disabled,
|
||||
// we need the updated tui.* variables
|
||||
effects = map[string]string{
|
||||
"{bold}": tui.BOLD,
|
||||
"{dim}": tui.DIM,
|
||||
"{r}": tui.RED,
|
||||
"{g}": tui.GREEN,
|
||||
"{b}": tui.BLUE,
|
||||
"{y}": tui.YELLOW,
|
||||
"{fb}": tui.FOREBLACK,
|
||||
"{fw}": tui.FOREWHITE,
|
||||
"{bdg}": tui.BACKDARKGRAY,
|
||||
"{br}": tui.BACKRED,
|
||||
"{bg}": tui.BACKGREEN,
|
||||
"{by}": tui.BACKYELLOW,
|
||||
"{blb}": tui.BACKLIGHTBLUE, // Ziggy this is for you <3
|
||||
"{reset}": tui.RESET,
|
||||
}
|
||||
return Prompt{}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue