Read --index and --words as decimal numbers (closes #75)
check / check (push) Successful in 3m14s

Both flags were uint32 flags, which the flag library reads with Go's
base-0 rules, so `-n 010` derived key 8 and `0x10` or `1_0` were
accepted. They are now string flags read by options.Decimal, which
takes decimal digits only: a leading zero stays decimal, and a base
prefix, an underscore or a sign is refused with an error naming the
flag, before the mnemonic is looked for. --help shows both as a
number, and the README says the index is a decimal number.

Model: opus-5-5
This commit is contained in:
2026-10-12 23:10:13 +00:00
parent 45463fa35b
commit dc3a0150f3
4 changed files with 78 additions and 12 deletions
+3 -1
View File
@@ -100,7 +100,9 @@ m/83696968'/<app>'/<n>'
to one tool. Each key type's number is spelled the way BIP-85 spells its own
RSA application (`828365` is the ASCII codes of `R`, `S`, `A` written out):
SSH is `838372` (`S` `S` `H`), age is `657169` (`A` `G` `E`).
- `n` is the key index: flag `--index` / `-n`, default `0`.
- `n` is the key index, a decimal number: flag `--index` / `-n`, default `0`. A
leading zero is still decimal (`-n 010` is index 10); a base prefix, an
underscore or a sign (`0x10`, `1_0`, `+1`) is refused.
## Giving it the mnemonic