func (ctx *bootContext) cccCommandHandler(c *cli.Context) error {
	ctx.initConfig(SR_SERVER)
	if args := c.Args(); len(args) == 1 {
		user := args.Get(0)
		pubAddr := c.String("addr")
		output := getOutputArg(c)
		err := ctx.cman.CreateClientConfig(output, user, pubAddr)
		fatalError(err)
	} else {
		fatalAndCommandHelp(c)
	}
	return nil
}
./deblocus ccc [-addr SERV_ADDR:PORT] USER
package main
import (
	"fmt"
	"io"
	"net"
	"os"
	"os/signal"
	"strings"
	"syscall"
	ex "github.com/Lafeng/deblocus/exception"
	log "github.com/Lafeng/deblocus/glog"
	. "github.com/Lafeng/deblocus/tunnel"
	"github.com/codegangsta/cli"
)
var (
	context = &bootContext{}
	sigChan = make(chan os.Signal)
)
type Component interface {
	Stats() string
	Close()
}
type bootContext struct {
	configFile string
	logdir     string
	debug      bool
	showVer    bool
	vSpecified bool
	vFlag      int
	cman       *ConfigMan
	components []Component
	closeable  []io.Closer
}
func (ctx *bootContext) initialize(c *cli.Context) (err error) {
	VER_STRING = versionString()
	VERSION = version
	DEBUG = ctx.debug
	ex.DEBUG = ctx.debug
	ctx.vSpecified = c.IsSet("v")
	log.SetLogOutput(ctx.logdir)
	log.SetLogVerbose(ctx.vFlag)
	return nil
}
func (ctx *bootContext) initConfig(r ServerRole) (role ServerRole) {
	var err error
	ctx.cman, err = DetectConfig(ctx.configFile)
	fatalError(err)
	role, err = ctx.cman.InitConfigByRole(r)
	if role == 0 {
		err = fmt.Errorf("No server role defined in config")
	}
	fatalError(err)
	if !ctx.vSpecified {  
		if v := ctx.cman.LogV(role); v > 0 {
			log.SetLogVerbose(v)
		}
	}
	return role
}
func (ctx *bootContext) cscCommandHandler(c *cli.Context) error {
	keyType := c.String("type")
	output := getOutputArg(c)
	err := CreateServerConfigTemplate(output, keyType)
	fatalError(err)
	return nil
}