summaryrefslogtreecommitdiff
path: root/args.go
diff options
context:
space:
mode:
authorAdrien Hopkins <adrien.p.hopkins@gmail.com>2023-09-04 19:53:20 -0500
committerAdrien Hopkins <adrien.p.hopkins@gmail.com>2023-09-04 19:53:20 -0500
commitd034179fde42c4fc633b98fef6e84c2e0d1c2834 (patch)
treea9969a5ab054d4db50d6eb18f9710af5855c60fa /args.go
parenta663fa77cde6ad48f29abd6973211c179ff32464 (diff)
Add ability to show full digit maps
Full digit maps will show every digit from 0 to 35, regardless of the radix. This allows you to see extra fractions for small radices and to get a digit map for radices above 36. This isn't enabled by default because the extra "digits" added for small radices aren't actually digits - so it may be unintuitive. There are also some situations where only a radix's actual digits matter, such as multiplication tables.
Diffstat (limited to 'args.go')
-rw-r--r--args.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/args.go b/args.go
index 10c28b1..f2ede5d 100644
--- a/args.go
+++ b/args.go
@@ -13,6 +13,7 @@ const ProgramVersion = "1.0.0-alpha+dev"
type args struct {
Radix uint
Compact bool
+ FullMap bool
// If true, exit the program immediately after parsing args.
Exit bool
}
@@ -20,6 +21,9 @@ type args struct {
func parseArgs() (args, error) {
var a args
flag.BoolVar(&a.Compact, "c", false, "Compact the output display")
+ flag.BoolVar(&a.FullMap, "f", false,
+ fmt.Sprintf("Show full digit map (up to %d) for every radix",
+ maxSmallRadix))
help := flag.Bool("?", false,
"Get information about program usage then exit")
version := flag.Bool("V", false,