Skip to content

Commit

Permalink
match other executables
Browse files Browse the repository at this point in the history
  • Loading branch information
tvanriper committed Mar 24, 2022
1 parent dc75e9a commit 90ee94c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions cmd/apscan/main.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
package main

import (
"flag"
"fmt"

"github.com/tvanriper/go-wireless"
)

func main() {
iface, ok := wireless.DefaultInterface()
if !ok {
panic("no wifi cards on the system")
var iface string
flag.StringVar(&iface, "i", "", "interface to use")
flag.Parse()

if iface == "" {
var ok bool
iface, ok = wireless.DefaultInterface()
if !ok {
panic("no wifi cards on the system")
}
}
fmt.Printf("Using interface: %s\n", iface)

Expand Down

0 comments on commit 90ee94c

Please sign in to comment.