Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make achcli -skip-validation flag not depend on -validate <filepath> being present #1415

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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