NAME
list-bca-branches - BCA branches
VERSION
This document describes version 0.143 of list-bca-branches (from Perl distribution App-IndonesianBankingUtils), released on 2019-10-15.
SYNOPSIS
Usage:
% list-bca-branches [options] [query]
DESCRIPTION
REPLACE ME
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.
- --field=s@
-
Select fields to return.
Default value:
["code"]
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 city_code options
- --city-code-contains=s
-
Only return records where the 'city_code' field contains specified text.
- --city-code-in-json=s
-
Only return records where the 'city_code' field is in the specified values (JSON-encoded).
See
--city-code-in
. - --city-code-in=s@
-
Only return records where the 'city_code' field is in the specified values.
Can be specified multiple times.
- --city-code-is=s
-
Only return records where the 'city_code' field equals specified value.
- --city-code-isnt=s
-
Only return records where the 'city_code' field does not equal specified value.
- --city-code-max=s
-
Only return records where the 'city_code' field is less than or equal to specified value.
- --city-code-min=s
-
Only return records where the 'city_code' field is greater than or equal to specified value.
- --city-code-not-contains=s
-
Only return records where the 'city_code' field does not contain specified text.
- --city-code-not-in-json=s
-
Only return records where the 'city_code' field is not in the specified values (JSON-encoded).
See
--city-code-not-in
. - --city-code-not-in=s@
-
Only return records where the 'city_code' field is not in the specified values.
Can be specified multiple times.
- --city-code-xmax=s
-
Only return records where the 'city_code' field is less than specified value.
- --city-code-xmin=s
-
Only return records where the 'city_code' field is greater than specified value.
- --city-code=s
-
Only return records where the 'city_code' field equals specified value.
Filtering for city_name options
- --city-name-contains=s
-
Only return records where the 'city_name' field contains specified text.
- --city-name-in-json=s
-
Only return records where the 'city_name' field is in the specified values (JSON-encoded).
See
--city-name-in
. - --city-name-in=s@
-
Only return records where the 'city_name' field is in the specified values.
Can be specified multiple times.
- --city-name-is=s
-
Only return records where the 'city_name' field equals specified value.
- --city-name-isnt=s
-
Only return records where the 'city_name' field does not equal specified value.
- --city-name-max=s
-
Only return records where the 'city_name' field is less than or equal to specified value.
- --city-name-min=s
-
Only return records where the 'city_name' field is greater than or equal to specified value.
- --city-name-not-contains=s
-
Only return records where the 'city_name' field does not contain specified text.
- --city-name-not-in-json=s
-
Only return records where the 'city_name' field is not in the specified values (JSON-encoded).
See
--city-name-not-in
. - --city-name-not-in=s@
-
Only return records where the 'city_name' field is not in the specified values.
Can be specified multiple times.
- --city-name-xmax=s
-
Only return records where the 'city_name' field is less than specified value.
- --city-name-xmin=s
-
Only return records where the 'city_name' field is greater than specified value.
- --city-name=s
-
Only return records where the 'city_name' field equals specified value.
Filtering for code options
- --code-contains=s
-
Only return records where the 'code' field contains specified text.
- --code-in-json=s
-
Only return records where the 'code' field is in the specified values (JSON-encoded).
See
--code-in
. - --code-in=s@
-
Only return records where the 'code' field is in the specified values.
Can be specified multiple times.
- --code-is=s
-
Only return records where the 'code' field equals specified value.
- --code-isnt=s
-
Only return records where the 'code' field does not equal specified value.
- --code-max=s
-
Only return records where the 'code' field is less than or equal to specified value.
- --code-min=s
-
Only return records where the 'code' field is greater than or equal to specified value.
- --code-not-contains=s
-
Only return records where the 'code' field does not contain specified text.
- --code-not-in-json=s
-
Only return records where the 'code' field is not in the specified values (JSON-encoded).
See
--code-not-in
. - --code-not-in=s@
-
Only return records where the 'code' field is not in the specified values.
Can be specified multiple times.
- --code-xmax=s
-
Only return records where the 'code' field is less than specified value.
- --code-xmin=s
-
Only return records where the 'code' field is greater than specified value.
- --code=s
-
Only return records where the 'code' field equals specified value.
Filtering for ctime options
- --ctime-contains=s
-
Only return records where the 'ctime' field contains specified text.
- --ctime-in-json=s
-
Only return records where the 'ctime' field is in the specified values (JSON-encoded).
See
--ctime-in
. - --ctime-in=s@
-
Only return records where the 'ctime' field is in the specified values.
Can be specified multiple times.
- --ctime-is=s
-
Only return records where the 'ctime' field equals specified value.
- --ctime-isnt=s
-
Only return records where the 'ctime' field does not equal specified value.
- --ctime-max=s
-
Only return records where the 'ctime' field is less than or equal to specified value.
- --ctime-min=s
-
Only return records where the 'ctime' field is greater than or equal to specified value.
- --ctime-not-contains=s
-
Only return records where the 'ctime' field does not contain specified text.
- --ctime-not-in-json=s
-
Only return records where the 'ctime' field is not in the specified values (JSON-encoded).
See
--ctime-not-in
. - --ctime-not-in=s@
-
Only return records where the 'ctime' field is not in the specified values.
Can be specified multiple times.
- --ctime-xmax=s
-
Only return records where the 'ctime' field is less than specified value.
- --ctime-xmin=s
-
Only return records where the 'ctime' field is greater than specified value.
- --ctime=s
-
Only return records where the 'ctime' field equals specified value.
Filtering for name options
- --name-contains=s
-
Only return records where the 'name' field contains specified text.
- --name-in-json=s
-
Only return records where the 'name' field is in the specified values (JSON-encoded).
See
--name-in
. - --name-in=s@
-
Only return records where the 'name' field is in the specified values.
Can be specified multiple times.
- --name-is=s
-
Only return records where the 'name' field equals specified value.
- --name-isnt=s
-
Only return records where the 'name' field does not equal specified value.
- --name-max=s
-
Only return records where the 'name' field is less than or equal to specified value.
- --name-min=s
-
Only return records where the 'name' field is greater than or equal to specified value.
- --name-not-contains=s
-
Only return records where the 'name' field does not contain specified text.
- --name-not-in-json=s
-
Only return records where the 'name' field is not in the specified values (JSON-encoded).
See
--name-not-in
. - --name-not-in=s@
-
Only return records where the 'name' field is not in the specified values.
Can be specified multiple times.
- --name-xmax=s
-
Only return records where the 'name' field is less than specified value.
- --name-xmin=s
-
Only return records where the 'name' field is greater than specified value.
- --name=s
-
Only return records where the 'name' field equals specified value.
Filtering for note options
- --note-contains=s
-
Only return records where the 'note' field contains specified text.
- --note-in-json=s
-
Only return records where the 'note' field is in the specified values (JSON-encoded).
See
--note-in
. - --note-in=s@
-
Only return records where the 'note' field is in the specified values.
Can be specified multiple times.
- --note-is=s
-
Only return records where the 'note' field equals specified value.
- --note-isnt=s
-
Only return records where the 'note' field does not equal specified value.
- --note-max=s
-
Only return records where the 'note' field is less than or equal to specified value.
- --note-min=s
-
Only return records where the 'note' field is greater than or equal to specified value.
- --note-not-contains=s
-
Only return records where the 'note' field does not contain specified text.
- --note-not-in-json=s
-
Only return records where the 'note' field is not in the specified values (JSON-encoded).
See
--note-not-in
. - --note-not-in=s@
-
Only return records where the 'note' field is not in the specified values.
Can be specified multiple times.
- --note-xmax=s
-
Only return records where the 'note' field is less than specified value.
- --note-xmin=s
-
Only return records where the 'note' field is greater than specified value.
- --note=s
-
Only return records where the 'note' 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]
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-bca-branches list-bca-branches
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-bca-branches 'p/*/`list-bca-branches`/'
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-bca-branches.conf, ~/list-bca-branches.conf, or /etc/list-bca-branches.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.
Finally, you can 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 has value equals something: [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 something: [env=HOSTNAME!=blink ...]
or [SOMESECTION env=HOSTNAME!=blink ...]
. If you only want a section to be read when an environment variable contains something: [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.
List of available configuration parameters:
city_code (see --city-code)
city_code.contains (see --city-code-contains)
city_code.in (see --city-code-in)
city_code.is (see --city-code-is)
city_code.isnt (see --city-code-isnt)
city_code.max (see --city-code-max)
city_code.min (see --city-code-min)
city_code.not_contains (see --city-code-not-contains)
city_code.not_in (see --city-code-not-in)
city_code.xmax (see --city-code-xmax)
city_code.xmin (see --city-code-xmin)
city_name (see --city-name)
city_name.contains (see --city-name-contains)
city_name.in (see --city-name-in)
city_name.is (see --city-name-is)
city_name.isnt (see --city-name-isnt)
city_name.max (see --city-name-max)
city_name.min (see --city-name-min)
city_name.not_contains (see --city-name-not-contains)
city_name.not_in (see --city-name-not-in)
city_name.xmax (see --city-name-xmax)
city_name.xmin (see --city-name-xmin)
code (see --code)
code.contains (see --code-contains)
code.in (see --code-in)
code.is (see --code-is)
code.isnt (see --code-isnt)
code.max (see --code-max)
code.min (see --code-min)
code.not_contains (see --code-not-contains)
code.not_in (see --code-not-in)
code.xmax (see --code-xmax)
code.xmin (see --code-xmin)
ctime (see --ctime)
ctime.contains (see --ctime-contains)
ctime.in (see --ctime-in)
ctime.is (see --ctime-is)
ctime.isnt (see --ctime-isnt)
ctime.max (see --ctime-max)
ctime.min (see --ctime-min)
ctime.not_contains (see --ctime-not-contains)
ctime.not_in (see --ctime-not-in)
ctime.xmax (see --ctime-xmax)
ctime.xmin (see --ctime-xmin)
detail (see --detail)
fields (see --field)
format (see --format)
naked_res (see --naked-res)
name (see --name)
name.contains (see --name-contains)
name.in (see --name-in)
name.is (see --name-is)
name.isnt (see --name-isnt)
name.max (see --name-max)
name.min (see --name-min)
name.not_contains (see --name-not-contains)
name.not_in (see --name-not-in)
name.xmax (see --name-xmax)
name.xmin (see --name-xmin)
note (see --note)
note.contains (see --note-contains)
note.in (see --note-in)
note.is (see --note-is)
note.isnt (see --note-isnt)
note.max (see --note-max)
note.min (see --note-min)
note.not_contains (see --note-not-contains)
note.not_in (see --note-not-in)
note.xmax (see --note-xmax)
note.xmin (see --note-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_BCA_BRANCHES_OPT => str
Specify additional command-line options.
FILES
~/.config/list-bca-branches.conf
~/list-bca-branches.conf
/etc/list-bca-branches.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.
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.
AUTHOR
perlancar <perlancar@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2019, 2018, 2017, 2016, 2015 by 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.