mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 13:33:21 -07:00
fix: fixed help menu padding
This commit is contained in:
parent
8343bf7030
commit
3c400d2905
2 changed files with 45 additions and 29 deletions
|
@ -48,7 +48,6 @@ type Session struct {
|
|||
|
||||
CoreHandlers []CommandHandler `json:"-"`
|
||||
Modules []Module `json:"-"`
|
||||
HelpPadding int `json:"-"`
|
||||
|
||||
Events *EventPool `json:"-"`
|
||||
}
|
||||
|
@ -128,9 +127,7 @@ func New() (*Session, error) {
|
|||
|
||||
CoreHandlers: make([]CommandHandler, 0),
|
||||
Modules: make([]Module, 0),
|
||||
HelpPadding: 0,
|
||||
|
||||
Events: nil,
|
||||
Events: nil,
|
||||
}
|
||||
|
||||
if s.Options, err = core.ParseOptions(); err != nil {
|
||||
|
@ -269,19 +266,6 @@ func (s *Session) Close() {
|
|||
|
||||
func (s *Session) Register(mod Module) error {
|
||||
s.Modules = append(s.Modules, mod)
|
||||
|
||||
for _, h := range mod.Handlers() {
|
||||
if len(h.Name) > s.HelpPadding {
|
||||
s.HelpPadding = len(h.Name)
|
||||
}
|
||||
}
|
||||
|
||||
for _, p := range mod.Parameters() {
|
||||
if len(p.Name) > s.HelpPadding {
|
||||
s.HelpPadding = len(p.Name)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue