MCPcopy Create free account
hub / github.com/DNAProject/DNA / checkNumber

Function checkNumber

cmd/account.go:166–182  ·  view source on GitHub ↗
(ctx *cli.Context)

Source from the content-addressed store, hash-verified

164 }
165}
166func 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}
183func checkLabel(ctx *cli.Context) string {
184 if ctx.IsSet(utils.GetFlagName(utils.AccountLabelFlag)) {
185 return ctx.String(utils.GetFlagName(utils.AccountLabelFlag))

Callers 1

accountCreateFunction · 0.85

Calls 1

GetFlagNameFunction · 0.92

Tested by

no test coverage detected