cmd/achcli: fixup formatting with -flatten
@@ -19,17 +19,7 @@ func dumpFiles(paths []string) error {
if err != nil {
fmt.Printf("WARN: problem reading %s:\n %v\n\n", paths[i], err)
}
- if *flagMerge {
files = append(files, f)
- } else {
- if i > 0 {
- fmt.Println("") // extra newline between multiple ACH files
- }
- fmt.Printf("Describing ACH file '%s'\n\n", paths[i])
- describe.File(os.Stdout, f, &describe.Opts{
- MaskAccountNumbers: *flagMask,
- })
- }
}
if *flagMerge {
@@ -37,12 +27,13 @@ func dumpFiles(paths []string) error {
if err != nil {
fmt.Printf("ERROR: merging files: %v\n", err)
}
- fmt.Printf("Describing %d file(s) merged into %d file(s)\n", len(paths), len(files))
+ fmt.Printf("Describing %d file(s) merged into %d file(s)\n", len(paths), len(merged))
files = merged
}
if *flagFlatten {
for i := range files {
+ fmt.Printf("attempting flattening %d\n", i)
file, err := files[i].FlattenBatches()
if err != nil {
fmt.Printf("ERROR: problem flattening file: %v\n", err)
@@ -55,6 +46,9 @@ func dumpFiles(paths []string) error {
if i > 0 && len(files) > 1 {
fmt.Println("") // extra newline between multiple ACH files
}
+ if !*flagMerge {
+ fmt.Printf("Describing ACH file '%s'\n\n", paths[i])
+ }
if files[i] != nil {
describe.File(os.Stdout, files[i], &describe.Opts{
MaskAccountNumbers: *flagMask,
