func main() {
	var output, logDir string
	var showVersion bool
	flag.Usage = showUsage
	flag.StringVar(&context.config, "config", "", "indicate Config if in nontypical path")
	flag.StringVar(&output, "o", "", "output file")
	flag.BoolVar(&context.csc, "csc", false, "Server;;Create Server Config")
	flag.BoolVar(&context.icc, "icc", false, "Server;;Issue Client Credential for user//-icc <Server public address> <User1> <User2>...")
	flag.BoolVar(&context.isServ, "serv", false, "Server;;run as Server explicitly")
	flag.BoolVar(&showVersion, "V", false, "show Version")
	flag.StringVar(&context.verbosity, "v", "", "Verbose log level")
	flag.StringVar(&logDir, "logdir", "", "if non-empty will write log into the Directory")
	flag.BoolVar(&context.debug, "debug", false, "debug")
	flag.Parse()

	if showVersion {
		fmt.Println(versionString())
		return
	}

	context.parse()
	// toStd bool, logDir string
	log.Set_output(true, logDir)

	if context.csc {
		t.Generate_d5sFile(output, nil)
		return
	}

	if context.icc {
		context.csc_process(output)
		return
	}

	if context.isServ {
		go context.startServer()
	} else {
		go context.startClient()
	}
	waitSignal()
}
func init() {
	runtime.GOMAXPROCS(runtime.NumCPU())
	log.Set_output(true, "")
	log.Set_Verbose(1)
}