@@ -12,6 +12,7 @@ import (
1212 "strings"
1313
1414 "github.com/moov-io/ach"
15+ "github.com/moov-io/ach/cmd/achcli/fix"
1516)
1617
1718var (
3334
3435 flagSkipValidation = flag .Bool ("skip-validation" , false , "Skip all validation checks" )
3536 flagValidateOpts = flag .String ("validate" , "" , "Path to config file in json format to enable validation opts" )
37+
38+ // Fix commands
39+ flagFix = flag .Bool ("fix" , false , "Trigger fix tasks" )
40+ flagUpdateEED = flag .String ("update-eed" , "" , "Set the EffectiveEntryDate to a new value" )
3641)
3742
3843func main () {
@@ -78,6 +83,21 @@ func main() {
7883 os .Exit (1 )
7984 }
8085
86+ case * flagFix :
87+ if len (args ) != 1 {
88+ fmt .Printf ("ERROR: unexpected %d arguments: %#v\n " , len (args ), args )
89+ os .Exit (1 )
90+ }
91+ conf := fix.Config {
92+ UpdateEED : * flagUpdateEED ,
93+ }
94+ newpath , err := fix .Perform (args [0 ], conf );
95+ if err != nil {
96+ fmt .Printf ("ERROR: %v\n " , err )
97+ os .Exit (1 )
98+ }
99+ fmt .Printf ("New file: %s\n " , newpath )
100+
81101 case * flagReformat != "" && len (args ) == 1 :
82102 if err := reformat (* flagReformat , args [0 ], validateOpts ); err != nil {
83103 fmt .Printf ("ERROR: %v\n " , err )
0 commit comments