diff options
Diffstat (limited to 'args.go')
| -rw-r--r-- | args.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -16,6 +16,7 @@ type args struct { FullMap bool ExactMTCLarge bool TotativeDigits bool + DigitMapOnly bool // If true, exit the program immediately after parsing args. Exit bool } @@ -23,6 +24,8 @@ type args struct { func parseArgs() (args, error) { var a args flag.BoolVar(&a.Compact, "c", false, "Compact the output display") + flag.BoolVar(&a.DigitMapOnly, "d", false, + "Show only the digit map; incompatible with -m and -t") flag.BoolVar(&a.FullMap, "f", false, fmt.Sprintf("Show full digit map (up to %d) for every radix", maxSmallRadix)) @@ -45,6 +48,8 @@ func parseArgs() (args, error) { return args{Exit: true}, nil } else if a.Compact && a.TotativeDigits { return args{}, errors.New("You cannot use both -t and -c at the same time.") + } else if a.DigitMapOnly && (a.TotativeDigits || a.ExactMTCLarge) { + return args{}, errors.New("You cannot use both -d and -t or -m at the same time.") } else { if flag.NArg() == 1 { if radix, err := strconv.ParseUint(flag.Arg(0), 0, 0); err == nil { |
