iban_validation_cli
A command line front end for iban_validation_rs: read IBANs from standard input or a file, print whether each one is valid along with the bank and branch identifiers the registry defines for its country.
It exists so the library can be tried, or dropped into a shell pipeline, without writing any code. Like the core crate it has no dependencies (argument parsing included).
Install
The installed binary carries the crate's name, iban_validation_cli.
Use
|
|
Text output is tab separated: iban, valid/invalid, then the bank and branch identifiers
(- where the country defines none), or the reason when the IBAN is rejected.
CSV output adds a header and an error column, for loading straight into a dataframe:
--quiet reports through the exit code only, which is what you want in a check step:
&&
Options
| Option | Effect |
|---|---|
-f, --format <text|csv> |
Output format, default text |
-q, --quiet |
Print nothing; the exit code carries the result |
--print-format |
Accept print format input, removing spaces before validating |
--non-registry |
Also accept the 22 community-sourced, non-registry countries |
-h, --help |
Usage |
-V, --version |
Version, including the IBAN registry the data was generated from |
FILE is read one IBAN per line and empty lines are skipped. When it is absent or is -,
standard input is read.
Exit codes
| Code | Meaning |
|---|---|
0 |
Every IBAN read was valid (including when nothing was read) |
1 |
At least one IBAN was invalid |
2 |
The arguments or the input file could not be used |
Notes
Validation is the strict electronic-format path of the core crate, so an IBAN written with
spaces is rejected unless --print-format is passed. The non-registry countries are
community-sourced rather than SWIFT-registered and are therefore opt-in, matching the
CountrySet behaviour of the other wrappers.
Changes
- 0.1.30: updated to registry version 103 (a change to Brazil IBAN definition). rust updated to 1.99.0.
- 0.1.29: initial release.