diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-08-11 22:33:34 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-08-11 22:33:34 +0200 |
commit | 574fd098228f5b63d10a4a739ee7b8e6c668a671 (patch) | |
tree | 171ec68e046af60af0861ac42eeb6dc54138f7e7 /cmd/mfmt | |
parent | a0c502e3a1490e5b69bb550f2fb4f79fadfa34b7 (diff) |
More work on mintages
Diffstat (limited to 'cmd/mfmt')
-rw-r--r-- | cmd/mfmt/main.go | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/cmd/mfmt/main.go b/cmd/mfmt/main.go index cb9b0cd..263b258 100644 --- a/cmd/mfmt/main.go +++ b/cmd/mfmt/main.go @@ -50,17 +50,20 @@ func mfmt(path string, in io.Reader, out io.Writer) error { } fmt.Fprintf(out, `BEGIN %d`, data.StartYear) - if len(data.Circ) != 0 { - fmt.Fprintln(out, "\n\nBEGIN CIRC") - formatSection(out, data.Circ) - } - if len(data.BU) != 0 { - fmt.Fprintln(out, "\n\nBEGIN BU") - formatSection(out, data.BU) - } - if len(data.Proof) != 0 { - fmt.Fprintln(out, "\n\nBEGIN PROOF") - formatSection(out, data.Proof) + for i, tbl := range data.Tables { + if len(tbl) != 0 { + var section string + switch mintage.CoinType(i) { + case mintage.TypeCirculated: + section = "CIRC" + case mintage.TypeNIFC: + section = "BU" + case mintage.TypeProof: + section = "PROOF" + } + fmt.Fprintf(out, "\n\nBEGIN %s\n", section) + formatSection(out, tbl) + } } fmt.Fprintln(out, "") |