mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
fix: better 'active' menu
This commit is contained in:
parent
ce3de2e0ad
commit
892659ba7f
2 changed files with 12 additions and 5 deletions
|
@ -104,6 +104,11 @@ func (p ModuleParam) Get(s *Session) (error, interface{}) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p ModuleParam) Dump(padding int) string {
|
||||||
|
return fmt.Sprintf(" "+core.YELLOW+"%"+strconv.Itoa(padding)+"s"+core.RESET+
|
||||||
|
" : %s\n", p.Name, p.Value)
|
||||||
|
}
|
||||||
|
|
||||||
func (p ModuleParam) Help(padding int) string {
|
func (p ModuleParam) Help(padding int) string {
|
||||||
return fmt.Sprintf(" "+core.YELLOW+"%"+strconv.Itoa(padding)+"s"+core.RESET+
|
return fmt.Sprintf(" "+core.YELLOW+"%"+strconv.Itoa(padding)+"s"+core.RESET+
|
||||||
" : "+
|
" : "+
|
||||||
|
|
|
@ -74,15 +74,17 @@ func (s *Session) activeHandler(args []string, sess *Session) error {
|
||||||
if m.Running() == false {
|
if m.Running() == false {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
fmt.Printf("[%s] %s (%s)\n", core.Green("active"), m.Name(), core.Dim(m.Description()))
|
|
||||||
|
fmt.Printf("%s (%s)\n", core.Bold(m.Name()), core.Dim(m.Description()))
|
||||||
params := m.Parameters()
|
params := m.Parameters()
|
||||||
if len(params) > 0 {
|
if len(params) > 0 {
|
||||||
for _, p := range params {
|
|
||||||
_, p.Value = s.Env.Get(p.Name)
|
|
||||||
fmt.Printf(" %s: '%s'\n", p.Name, core.Yellow(p.Value))
|
|
||||||
}
|
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
for _, p := range params {
|
||||||
|
fmt.Printf(p.Dump(s.HelpPadding))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Println()
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue