38 lines
676 B
Go
38 lines
676 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"os"
|
|
"path"
|
|
)
|
|
|
|
const (
|
|
_Version = "0.5.0"
|
|
)
|
|
|
|
var (
|
|
port string
|
|
debug bool
|
|
servers string
|
|
config string
|
|
version bool
|
|
)
|
|
|
|
func usage() {
|
|
fmt.Printf("Usage of %s:\n", path.Base(os.Args[0]))
|
|
fmt.Printf("\t-p <port>\n")
|
|
fmt.Printf("\t-D <debug [true|false]>\n")
|
|
fmt.Printf("\t-s <servers list [ip:port,ip:port...]>\n")
|
|
fmt.Printf("\t-c <config file>\n")
|
|
fmt.Println()
|
|
os.Exit(0)
|
|
}
|
|
|
|
func init() {
|
|
flag.StringVar(&port, "p", "4000", "port")
|
|
flag.BoolVar(&debug, "D", false, "debug")
|
|
flag.BoolVar(&debug, "v", false, "debug")
|
|
flag.StringVar(&servers, "s", "", "servers")
|
|
flag.StringVar(&config, "c", "", "config file")
|
|
}
|