diff options
| author | Adrien Hopkins <adrien.p.hopkins@gmail.com> | 2023-09-15 10:19:26 -0500 |
|---|---|---|
| committer | Adrien Hopkins <adrien.p.hopkins@gmail.com> | 2023-09-15 10:19:26 -0500 |
| commit | 23cc07dd1655df05f6967ce848169ab4c658e707 (patch) | |
| tree | 15a9fa0182742274b19978db600dd8778070cc93 /args.go | |
| parent | 58e9305753f41c401c248bfebc37b68fdd9ebe73 (diff) | |
Forbid -d when digit map cannot be shown
-d shows only the digit map and nothing else, so if the digit map cannot
be shown (e.g. radices above 36 without -f), it makes sense to forbid
this rather than print an empty string.
Diffstat (limited to 'args.go')
| -rw-r--r-- | args.go | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -61,6 +61,8 @@ func parseArgs() (args, error) { return args{}, uintParsingError(flag.Arg(0), err) } else if radix < 2 { return args{}, errors.New("Cannot use 0 or 1 as radices.") + } else if radix > maxSmallRadix && a.DigitMapOnly && !a.FullMap { + return args{}, errors.New("Used -d option, but digit map cannot be shown.") } a.Radix = uint(radix) |
