Read --index and --words as decimal numbers (closes #75)
check / check (push) Failing after 3m40s

Both flags were uint32 flags, which the flag library reads with base-0 rules, so `-n 010` derived key 8 and `0x10` or `1_0` were accepted. Both now hold options.Decimal, a flag value whose Set parses with strconv.ParseUint(text, 10, 32): a leading zero stays decimal, and a base prefix, an underscore, a sign or an empty value is refused with an error naming the flag while the flags are parsed, before any command runs. Its type is still named uint32, so --help is unchanged and GetUint32 still reads it back. The README says the index is a decimal number.

Model: opus-5-5
This commit was merged in pull request #81.
This commit is contained in:
2026-10-13 02:29:25 +02:00
parent 45463fa35b
commit efca0ebb39
4 changed files with 106 additions and 5 deletions
+3 -2
View File
@@ -31,8 +31,9 @@ func Command() *cobra.Command {
},
}
cmd.Flags().Uint32(
"words", childmnemonic.DefaultWords,
words := options.Decimal(childmnemonic.DefaultWords)
cmd.Flags().Var(
&words, "words",
"how long the child mnemonic is: 12, 18 or 24 words",
)