kappanhang/args.go

27 lines
471 B
Go
Raw Normal View History

2020-10-16 17:13:46 +02:00
package main
import (
"os"
"github.com/pborman/getopt"
)
var connectAddress string
2020-10-25 16:15:39 +01:00
var serialTCPPort uint16
2020-10-16 17:13:46 +02:00
func parseArgs() {
h := getopt.BoolLong("help", 'h', "display help")
a := getopt.StringLong("address", 'a', "IC-705", "Connect to address")
2020-10-25 16:15:39 +01:00
t := getopt.Uint16Long("serial-tcp-port", 'p', 4532, "Expose serial port as TCP port for rigctl")
2020-10-16 17:13:46 +02:00
getopt.Parse()
if *h || *a == "" {
getopt.Usage()
os.Exit(1)
}
connectAddress = *a
2020-10-25 16:15:39 +01:00
serialTCPPort = *t
2020-10-16 17:13:46 +02:00
}