本文整理匯總了Golang中github.com/eris-ltd/mint-client/Godeps/_workspace/src/github.com/codegangsta/cli.Context.Bool方法的典型用法代碼示例。如果您正苦於以下問題:Golang Context.Bool方法的具體用法?Golang Context.Bool怎麽用?Golang Context.Bool使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/eris-ltd/mint-client/Godeps/_workspace/src/github.com/codegangsta/cli.Context
的用法示例。
在下文中一共展示了Context.Bool方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: before
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: cliSend
func cliSend(c *cli.Context) {
chainID, nodeAddr, signAddr := c.String("chainID"), c.String("node-addr"), c.String("sign-addr")
sign, broadcast, wait := c.Bool("sign"), c.Bool("broadcast"), c.Bool("wait")
pubkey, amtS, nonceS, addr, toAddr := c.String("pubkey"), c.String("amt"), c.String("nonce"), c.String("addr"), c.String("to")
tx, err := core.Send(nodeAddr, pubkey, addr, toAddr, amtS, nonceS)
common.IfExit(err)
logger.Debugf("%v\n", tx)
unpackSignAndBroadcast(core.SignAndBroadcast(chainID, nodeAddr, signAddr, tx, sign, broadcast, wait))
}
示例3: cliRebond
func cliRebond(c *cli.Context) {
chainID, nodeAddr, signAddr := c.String("chainID"), c.String("node-addr"), c.String("sign-addr")
sign, broadcast, wait := c.Bool("sign"), c.Bool("broadcast"), c.Bool("wait")
addr, height := c.String("addr"), c.String("height")
tx, err := core.Rebond(addr, height)
common.IfExit(err)
logger.Debugf("%v\n", tx)
unpackSignAndBroadcast(core.SignAndBroadcast(chainID, nodeAddr, signAddr, tx, sign, broadcast, wait))
}
示例4: cliPermissions
func cliPermissions(c *cli.Context) {
chainID, nodeAddr, signAddr := c.String("chainID"), c.String("node-addr"), c.String("sign-addr")
sign, broadcast, wait := c.Bool("sign"), c.Bool("broadcast"), c.Bool("wait")
pubkey, nonceS, addr := c.String("pubkey"), c.String("nonce"), c.String("addr")
// all functions take at least 2 args (+ name)
if len(c.Args()) < 3 {
common.Exit(fmt.Errorf("Please enter the permission function you'd like to call, followed by it's arguments"))
}
permFunc := c.Args()[0]
tx, err := core.Permissions(nodeAddr, pubkey, addr, nonceS, permFunc, c.Args()[1:])
common.IfExit(err)
logger.Debugf("%v\n", tx)
unpackSignAndBroadcast(core.SignAndBroadcast(chainID, nodeAddr, signAddr, tx, sign, broadcast, wait))
}
示例5: cliName
func cliName(c *cli.Context) {
chainID, nodeAddr, signAddr := c.String("chainID"), c.String("node-addr"), c.String("sign-addr")
sign, broadcast, wait := c.Bool("sign"), c.Bool("broadcast"), c.Bool("wait")
pubkey, amtS, nonceS, feeS, addr := c.String("pubkey"), c.String("amt"), c.String("nonce"), c.String("fee"), c.String("addr")
if c.IsSet("data") && c.IsSet("data-file") {
common.Exit(fmt.Errorf("Please specify only one of --data and --data-file"))
}
name, data, dataFile := c.String("name"), c.String("data"), c.String("data-file")
if data == "" && dataFile != "" {
b, err := ioutil.ReadFile(dataFile)
common.IfExit(err)
data = string(b)
}
tx, err := core.Name(nodeAddr, pubkey, addr, amtS, nonceS, feeS, name, data)
common.IfExit(err)
logger.Debugf("%v\n", tx)
unpackSignAndBroadcast(core.SignAndBroadcast(chainID, nodeAddr, signAddr, tx, sign, broadcast, wait))
}