(ctx *cli.Context)
| 164 | } |
| 165 | } |
| 166 | func checkNumber(ctx *cli.Context) int { |
| 167 | numFlag := utils.GetFlagName(utils.AccountQuantityFlag) |
| 168 | if ctx.IsSet(numFlag) { |
| 169 | num := ctx.Uint(numFlag) |
| 170 | if num < 1 { |
| 171 | fmt.Println("the minimum number is 1, set to default value(1).") |
| 172 | return 1 |
| 173 | } |
| 174 | if num > 100 { |
| 175 | fmt.Println("the maximum number is 100, set to default value(1).") |
| 176 | return 1 |
| 177 | } |
| 178 | return int(num) |
| 179 | } else { |
| 180 | return 1 |
| 181 | } |
| 182 | } |
| 183 | func checkLabel(ctx *cli.Context) string { |
| 184 | if ctx.IsSet(utils.GetFlagName(utils.AccountLabelFlag)) { |
| 185 | return ctx.String(utils.GetFlagName(utils.AccountLabelFlag)) |
no test coverage detected