From 574fd098228f5b63d10a4a739ee7b8e6c668a671 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 11 Aug 2024 22:33:34 +0200 Subject: More work on mintages --- cmd/mfmt/main.go | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'cmd') 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, "") -- cgit v1.2.3