NAME
list-id-bank-cards - Prefix of card numbers issued in Indonesia
VERSION
This document describes version 0.146 of list-id-bank-cards (from Perl distribution App-IndonesianBankingUtils), released on 2021-08-26.
SYNOPSIS
Usage:
% list-id-bank-cards [--config-path=path|-c|--no-config|-C] [--config-profile=profile|-P] [--detail|-l|--no-detail|--nodetail] [(--exclude-field=str)+] [(--field=str)+] [--format=name|--json] [--ind-description-contains=str] [(--ind-description-in=str)+] [--ind-description-is=str] [--ind-description-isnt=str] [--ind-description-max=str] [--ind-description-min=str] [--ind-description-not-contains=str] [(--ind-description-not-in=str)+] [--ind-description-xmax=str] [--ind-description-xmin=str] [--ind-description=str] [(--issuer-id-in=int)+] [--issuer-id-is=int] [--issuer-id-isnt=int] [--issuer-id-max=int] [--issuer-id-min=int] [(--issuer-id-not-in=int)+] [--issuer-id-xmax=int] [--issuer-id-xmin=int] [--issuer-id=int] [--(no)naked-res] [--no-env] [--page-result[=program]|--view-result[=program]] [--prefix-contains=str] [(--prefix-in=str)+] [--prefix-is=str] [--prefix-isnt=str] [--prefix-max=str] [--prefix-min=str] [--prefix-not-contains=str] [(--prefix-not-in=str)+] [--prefix-xmax=str] [--prefix-xmin=str] [--prefix=str] [--random|--no-random|--norandom] [--result-limit=int] [--result-start=int] [(--sort=str)+] [--with-field-names|--without-field-names] [--exclude-fields-json=json] [--fields-json=json] [--ind-description-in-json=json] [--ind-description-not-in-json=json] [--issuer-id-in-json=json] [--issuer-id-not-in-json=json] [--prefix-in-json=json] [--prefix-not-in-json=json] [--sort-json=json] -- [query]
DESCRIPTION
Data source is currently at https://github.com/sharyanto/gudangdata (table/idn_bank_card_prefix).
OPTIONS
*
marks required options.
Configuration options
- --config-path=s, -c
-
Set path to configuration file.
- --config-profile=s, -P
-
Set configuration profile to use.
- --no-config, -C
-
Do not use any configuration file.
Environment options
Field selection options
- --detail, -l
-
Return array of full records instead of just ID fields.
By default, only the key (ID) field is returned per result entry.
- --exclude-field=s@
-
Select fields to return.
Can be specified multiple times.
- --exclude-fields-json=s
-
Select fields to return (JSON-encoded).
See
--exclude-field
. - --field=s@
-
Select fields to return.
Default value:
["prefix"]
Can be specified multiple times.
- --fields-json=s
-
Select fields to return (JSON-encoded).
See
--field
. - --with-field-names
-
Return field names in each record (as hash/associative array).
When enabled, function will return each record as hash/associative array (field name => value pairs). Otherwise, function will return each record as list/array (field value, field value, ...).
Filtering for ind_description options
- --ind-description-contains=s
-
Only return records where the 'ind_description' field contains specified text.
- --ind-description-in-json=s
-
Only return records where the 'ind_description' field is in the specified values (JSON-encoded).
See
--ind-description-in
. - --ind-description-in=s@
-
Only return records where the 'ind_description' field is in the specified values.
Can be specified multiple times.
- --ind-description-is=s
-
Only return records where the 'ind_description' field equals specified value.
- --ind-description-isnt=s
-
Only return records where the 'ind_description' field does not equal specified value.
- --ind-description-max=s
-
Only return records where the 'ind_description' field is less than or equal to specified value.
- --ind-description-min=s
-
Only return records where the 'ind_description' field is greater than or equal to specified value.
- --ind-description-not-contains=s
-
Only return records where the 'ind_description' field does not contain specified text.
- --ind-description-not-in-json=s
-
Only return records where the 'ind_description' field is not in the specified values (JSON-encoded).
See
--ind-description-not-in
. - --ind-description-not-in=s@
-
Only return records where the 'ind_description' field is not in the specified values.
Can be specified multiple times.
- --ind-description-xmax=s
-
Only return records where the 'ind_description' field is less than specified value.
- --ind-description-xmin=s
-
Only return records where the 'ind_description' field is greater than specified value.
- --ind-description=s
-
Only return records where the 'ind_description' field equals specified value.
Filtering for issuer_id options
- --issuer-id-in-json=s
-
Only return records where the 'issuer_id' field is in the specified values (JSON-encoded).
See
--issuer-id-in
. - --issuer-id-in=s@
-
Only return records where the 'issuer_id' field is in the specified values.
Can be specified multiple times.
- --issuer-id-is=s
-
Only return records where the 'issuer_id' field equals specified value.
- --issuer-id-isnt=s
-
Only return records where the 'issuer_id' field does not equal specified value.
- --issuer-id-max=s
-
Only return records where the 'issuer_id' field is less than or equal to specified value.
- --issuer-id-min=s
-
Only return records where the 'issuer_id' field is greater than or equal to specified value.
- --issuer-id-not-in-json=s
-
Only return records where the 'issuer_id' field is not in the specified values (JSON-encoded).
See
--issuer-id-not-in
. - --issuer-id-not-in=s@
-
Only return records where the 'issuer_id' field is not in the specified values.
Can be specified multiple times.
- --issuer-id-xmax=s
-
Only return records where the 'issuer_id' field is less than specified value.
- --issuer-id-xmin=s
-
Only return records where the 'issuer_id' field is greater than specified value.
- --issuer-id=s
-
Only return records where the 'issuer_id' field equals specified value.
Filtering for prefix options
- --prefix-contains=s
-
Only return records where the 'prefix' field contains specified text.
- --prefix-in-json=s
-
Only return records where the 'prefix' field is in the specified values (JSON-encoded).
See
--prefix-in
. - --prefix-in=s@
-
Only return records where the 'prefix' field is in the specified values.
Can be specified multiple times.
- --prefix-is=s
-
Only return records where the 'prefix' field equals specified value.
- --prefix-isnt=s
-
Only return records where the 'prefix' field does not equal specified value.
- --prefix-max=s
-
Only return records where the 'prefix' field is less than or equal to specified value.
- --prefix-min=s
-
Only return records where the 'prefix' field is greater than or equal to specified value.
- --prefix-not-contains=s
-
Only return records where the 'prefix' field does not contain specified text.
- --prefix-not-in-json=s
-
Only return records where the 'prefix' field is not in the specified values (JSON-encoded).
See
--prefix-not-in
. - --prefix-not-in=s@
-
Only return records where the 'prefix' field is not in the specified values.
Can be specified multiple times.
- --prefix-xmax=s
-
Only return records where the 'prefix' field is less than specified value.
- --prefix-xmin=s
-
Only return records where the 'prefix' field is greater than specified value.
- --prefix=s
-
Only return records where the 'prefix' field equals specified value.
Filtering options
Ordering options
- --random
-
Return records in random order.
- --sort-json=s
-
Order records according to certain field(s) (JSON-encoded).
See
--sort
. - --sort=s@
-
Order records according to certain field(s).
A list of field names separated by comma. Each field can be prefixed with '-' to specify descending order instead of the default ascending.
Can be specified multiple times.
Output options
- --format=s
-
Choose output format, e.g. json, text.
Default value:
undef
- --json
-
Set output format to json.
- --naked-res
-
When outputing as JSON, strip result envelope.
Default value:
0
By default, when outputing as JSON, the full enveloped result is returned, e.g.:
[200,"OK",[1,2,3],{"func.extra"=>4}]
The reason is so you can get the status (1st element), status message (2nd element) as well as result metadata/extra result (4th element) instead of just the result (3rd element). However, sometimes you want just the result, e.g. when you want to pipe the result for more post-processing. In this case you can use `--naked-res` so you just get:
[1,2,3]
- --page-result
-
Filter output through a pager.
- --view-result
-
View output using a viewer.
Paging options
- --result-limit=s
-
Only return a certain number of records.
- --result-start=s
-
Only return starting from the n'th record.
Default value:
1
Other options
COMPLETION
This script has shell tab completion capability with support for several shells.
bash
To activate bash completion for this script, put:
complete -C list-id-bank-cards list-id-bank-cards
in your bash startup (e.g. ~/.bashrc). Your next shell session will then recognize tab completion for the command. Or, you can also directly execute the line above in your shell to activate immediately.
It is recommended, however, that you install modules using cpanm-shcompgen which can activate shell completion for scripts immediately.
tcsh
To activate tcsh completion for this script, put:
complete list-id-bank-cards 'p/*/`list-id-bank-cards`/'
in your tcsh startup (e.g. ~/.tcshrc). Your next shell session will then recognize tab completion for the command. Or, you can also directly execute the line above in your shell to activate immediately.
It is also recommended to install shcompgen (see above).
other shells
For fish and zsh, install shcompgen as described above.
CONFIGURATION FILE
This script can read configuration files. Configuration files are in the format of IOD, which is basically INI with some extra features.
By default, these names are searched for configuration filenames (can be changed using --config-path
): ~/.config/list-id-bank-cards.conf, ~/list-id-bank-cards.conf, or /etc/list-id-bank-cards.conf.
All found files will be read and merged.
To disable searching for configuration files, pass --no-config
.
You can put multiple profiles in a single file by using section names like [profile=SOMENAME]
or [SOMESECTION profile=SOMENAME]
. Those sections will only be read if you specify the matching --config-profile SOMENAME
.
You can also put configuration for multiple programs inside a single file, and use filter program=NAME
in section names, e.g. [program=NAME ...]
or [SOMESECTION program=NAME]
. The section will then only be used when the reading program matches.
You can also filter a section by environment variable using the filter env=CONDITION
in section names. For example if you only want a section to be read if a certain environment variable is true: [env=SOMEVAR ...]
or [SOMESECTION env=SOMEVAR ...]
. If you only want a section to be read when the value of an environment variable equals some string: [env=HOSTNAME=blink ...]
or [SOMESECTION env=HOSTNAME=blink ...]
. If you only want a section to be read when the value of an environment variable does not equal some string: [env=HOSTNAME!=blink ...]
or [SOMESECTION env=HOSTNAME!=blink ...]
. If you only want a section to be read when the value of an environment variable includes some string: [env=HOSTNAME*=server ...]
or [SOMESECTION env=HOSTNAME*=server ...]
. If you only want a section to be read when the value of an environment variable does not include some string: [env=HOSTNAME!*=server ...]
or [SOMESECTION env=HOSTNAME!*=server ...]
. Note that currently due to simplistic parsing, there must not be any whitespace in the value being compared because it marks the beginning of a new section filter or section name.
To load and configure plugins, you can use either the -plugins
parameter (e.g. -plugins=DumpArgs
or -plugins=DumpArgs@before_validate_args
), or use the [plugin=NAME ...]
sections, for example:
[plugin=DumpArgs]
-event=before_validate_args
-prio=99
[plugin=Foo]
-event=after_validate_args
arg1=val1
arg2=val2
which is equivalent to setting -plugins=-DumpArgs@before_validate_args@99,-Foo@after_validate_args,arg1,val1,arg2,val2
.
List of available configuration parameters:
detail (see --detail)
exclude_fields (see --exclude-field)
fields (see --field)
format (see --format)
ind_description (see --ind-description)
ind_description.contains (see --ind-description-contains)
ind_description.in (see --ind-description-in)
ind_description.is (see --ind-description-is)
ind_description.isnt (see --ind-description-isnt)
ind_description.max (see --ind-description-max)
ind_description.min (see --ind-description-min)
ind_description.not_contains (see --ind-description-not-contains)
ind_description.not_in (see --ind-description-not-in)
ind_description.xmax (see --ind-description-xmax)
ind_description.xmin (see --ind-description-xmin)
issuer_id (see --issuer-id)
issuer_id.in (see --issuer-id-in)
issuer_id.is (see --issuer-id-is)
issuer_id.isnt (see --issuer-id-isnt)
issuer_id.max (see --issuer-id-max)
issuer_id.min (see --issuer-id-min)
issuer_id.not_in (see --issuer-id-not-in)
issuer_id.xmax (see --issuer-id-xmax)
issuer_id.xmin (see --issuer-id-xmin)
naked_res (see --naked-res)
prefix (see --prefix)
prefix.contains (see --prefix-contains)
prefix.in (see --prefix-in)
prefix.is (see --prefix-is)
prefix.isnt (see --prefix-isnt)
prefix.max (see --prefix-max)
prefix.min (see --prefix-min)
prefix.not_contains (see --prefix-not-contains)
prefix.not_in (see --prefix-not-in)
prefix.xmax (see --prefix-xmax)
prefix.xmin (see --prefix-xmin)
query (see --query)
random (see --random)
result_limit (see --result-limit)
result_start (see --result-start)
sort (see --sort)
with_field_names (see --with-field-names)
ENVIRONMENT
LIST_ID_BANK_CARDS_OPT => str
Specify additional command-line options.
FILES
~/.config/list-id-bank-cards.conf
~/list-id-bank-cards.conf
/etc/list-id-bank-cards.conf
HOMEPAGE
Please visit the project's homepage at https://metacpan.org/release/App-IndonesianBankingUtils.
SOURCE
Source repository is at https://github.com/perlancar/perl-App-IndonesianBankingUtils.
AUTHOR
perlancar <perlancar@cpan.org>
CONTRIBUTING
To contribute, you can send patches by email/via RT, or send pull requests on GitHub.
Most of the time, you don't need to build the distribution yourself. You can simply modify the code, then test via:
% prove -l
If you want to build the distribution (e.g. to try to install it locally on your system), you can install Dist::Zilla, Dist::Zilla::PluginBundle::Author::PERLANCAR, and sometimes one or two other Dist::Zilla plugin and/or Pod::Weaver::Plugin. Any additional steps required beyond that are considered a bug and can be reported to me.
COPYRIGHT AND LICENSE
This software is copyright (c) 2021, 2020, 2019, 2018, 2017, 2016, 2015 by perlancar <perlancar@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
BUGS
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-IndonesianBankingUtils
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.