Moved remaining platform dependent UAPI code
This commit is contained in:
parent
18714fc4a4
commit
47f8a3d89a
4 changed files with 44 additions and 35 deletions
|
|
@ -1,11 +1,17 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
func printUsage() {
|
||||
fmt.Printf("usage:\n")
|
||||
fmt.Printf("%s [-f/--foreground] INTERFACE-NAME\n", os.Args[0])
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
// parse arguments
|
||||
|
|
@ -13,6 +19,7 @@ func main() {
|
|||
var foreground bool
|
||||
var interfaceName string
|
||||
if len(os.Args) < 2 || len(os.Args) > 3 {
|
||||
printUsage()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -21,6 +28,7 @@ func main() {
|
|||
case "-f", "--foreground":
|
||||
foreground = true
|
||||
if len(os.Args) != 3 {
|
||||
printUsage()
|
||||
return
|
||||
}
|
||||
interfaceName = os.Args[2]
|
||||
|
|
@ -28,6 +36,7 @@ func main() {
|
|||
default:
|
||||
foreground = false
|
||||
if len(os.Args) != 2 {
|
||||
printUsage()
|
||||
return
|
||||
}
|
||||
interfaceName = os.Args[1]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue