mirror of
https://github.com/bettercap/bettercap
synced 2025-07-31 04:00:09 -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
|
@ -95,13 +95,22 @@ type Session struct {
|
|||
}
|
||||
|
||||
func New() (*Session, error) {
|
||||
var err error
|
||||
opts, err := core.ParseOptions()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if *opts.NoColors || !tui.Effects() {
|
||||
tui.Disable()
|
||||
log.NoEffects = true
|
||||
}
|
||||
|
||||
s := &Session{
|
||||
Prompt: NewPrompt(),
|
||||
Env: nil,
|
||||
Active: false,
|
||||
Queue: nil,
|
||||
Prompt: NewPrompt(),
|
||||
Options: opts,
|
||||
Env: nil,
|
||||
Active: false,
|
||||
Queue: nil,
|
||||
|
||||
CoreHandlers: make([]CommandHandler, 0),
|
||||
Modules: make([]Module, 0),
|
||||
|
@ -109,15 +118,6 @@ func New() (*Session, error) {
|
|||
UnkCmdCallback: nil,
|
||||
}
|
||||
|
||||
if s.Options, err = core.ParseOptions(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if *s.Options.NoColors || !tui.Effects() {
|
||||
tui.Disable()
|
||||
log.NoEffects = true
|
||||
}
|
||||
|
||||
if *s.Options.CpuProfile != "" {
|
||||
if f, err := os.Create(*s.Options.CpuProfile); err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue