示例#1
0
文件: main.go 项目: digibib/gosmtpd
func main() {
	kingpin.Version("0.1.1")
	kingpin.Parse()
	forwardEnabled := false
	if *forwardhost != "" && *forwardport != "" {
		forwardEnabled = true
	}
	log.Println("Clenaup interval ", *cleanupInterval)

	serve(&MailServer{hostname: *hostname, port: *port, httpport: *webport, forwardEnabled: forwardEnabled, forwardHost: *forwardhost, forwardPort: *forwardport, expireinterval: *cleanupInterval})
}
示例#2
0
文件: sacloud.go 项目: dopin/go-jj
func Run(args []string) {
	kingpin.CommandLine.HelpFlag.Short('h')
	kingpin.Version(VERSION)

	opFmt := &OuputFormat{JSON: *json, TSV: *tsv}

	switch kingpin.MustParse(cli.Parse(args[1:])) {
	case "servers":
		listServers(opFmt)
	case "api":
		apiRequest(*apiMethod, *apiPath, opFmt)
	}
}