-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
39 lines (28 loc) · 870 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// SPDX-License-Identifier: GPL-3.0-or-later
package main
import (
"github.com/robgonnella/go-lanscan/internal/cli"
"github.com/robgonnella/go-lanscan/internal/core"
"github.com/robgonnella/go-lanscan/internal/logger"
"github.com/robgonnella/go-lanscan/pkg/network"
"github.com/robgonnella/go-lanscan/pkg/oui"
)
func main() {
log := logger.New()
userNet, err := network.NewDefaultNetwork()
if err != nil {
log.Fatal().Err(err).Msg("failed to find default network")
}
vendorRepo, err := oui.GetDefaultVendorRepo()
if err != nil {
log.Fatal().Err(err).Msg("failed to initialize vendor repo")
}
runner := core.New()
cmd, err := cli.Root(runner, userNet, vendorRepo)
if err != nil {
log.Fatal().Err(err).Msg("failed to initialize cli")
}
if err := cmd.Execute(); err != nil {
log.Fatal().Err(err).Msg("command encountered an error")
}
}