Skip to content

Commit

Permalink
Merge dd79715 into 6e97ac9
Browse files Browse the repository at this point in the history
  • Loading branch information
joanofxyz committed Apr 27, 2024
2 parents 6e97ac9 + dd79715 commit 247fb96
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
11 changes: 7 additions & 4 deletions cmd/achcli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ func main() {
}

func readValidationOpts(path string) *ach.ValidateOpts {
var opts ach.ValidateOpts

if *flagSkipValidation {
opts.SkipAll = true
return &opts
}

if path != "" {
// read config file
bs, readErr := os.ReadFile(path)
Expand All @@ -101,14 +108,10 @@ func readValidationOpts(path string) *ach.ValidateOpts {
os.Exit(1)
}

var opts ach.ValidateOpts
if err := json.Unmarshal(bs, &opts); err != nil {
fmt.Printf("ERROR: unmarshal of validate opts failed: %v\n", err)
os.Exit(1)
}
if *flagSkipValidation {
opts.SkipAll = true
}
return &opts
}
return nil
Expand Down
30 changes: 16 additions & 14 deletions docs/usage-command-line.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,37 @@ EXAMPLES
achcli -mask file.ach Print file details with personally identifiable information partially removed
achcli -reformat=json first.ach Convert an incoming ACH file into another format (options: ach, json)
achcli -validate opts.json file.ach Read an ACH File with the provided ValidateOpts
achcli -version Print the version of achcli (Example: v1.26.4)
achcli -version Print the version of achcli (Example: v1.38.0)
achcli 20060102.ach Summarize an ACH file for human readability
FLAGS
-diff
Compare two files against each other
Compare two files against each other
-flatten
Flatten batches in each file
Flatten batches in each file
-mask
Mask/hide full account numbers and individual names
Mask/hide full account numbers and individual names
-mask.accounts
Mask/hide full account numbers
Mask/hide full account numbers
-mask.corrections
Mask/Hide Corrected Data in Addenda98 records
Mask/Hide Corrected Data in Addenda98 records
-mask.names
Mask/hide full individual names
Mask/hide full individual names
-merge
Merge files before describing
Merge files before describing
-pretty
Display all values in their human readable format
Display all values in their human readable format
-pretty.amounts
Display human readable amounts instead of exact values
Display human readable amounts instead of exact values
-reformat string
Reformat an incoming ACH file to another format
-v Print verbose details about each ACH file
Reformat an incoming ACH file to another format
-skip-validation
Skip all validation checks
-v Print verbose details about each ACH file
-validate string
Path to config file in json format to enable validation opts
Path to config file in json format to enable validation opts
-version
Print moov-io/ach cli version
Print moov-io/ach cli version
```

## Install and Usage
Expand Down

0 comments on commit 247fb96

Please sign in to comment.