示例#1
0
文件: main.go 项目: alist/mint-client
func before(c *cli.Context) error {
	var level int
	if c.GlobalBool("debug") || c.Bool("debug") {
		level = 2
	}
	log.SetLoggers(level, os.Stdout, os.Stderr)
	return nil
}
示例#2
0
func before(cmd *cobra.Command, args []string) {
	config.Set("chain_id", chainidFlag)
	log.SetLoggers(logLevelFlag, os.Stdout, os.Stderr)

	if !strings.HasPrefix(nodeAddrFlag, "http://") {
		nodeAddrFlag = "http://" + nodeAddrFlag
	}
	if !strings.HasSuffix(nodeAddrFlag, "/") {
		nodeAddrFlag += "/"
	}

	if !strings.HasPrefix(signAddrFlag, "http://") {
		signAddrFlag = "http://" + signAddrFlag
	}
}