The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

list-id-localities - Localities (cities & regencies) in Indonesia

VERSION

This document describes version 0.01 of list-id-localities (from Perl distribution App-IndonesianLocaleUtils), released on 2015-07-10.

SYNOPSIS

Usage:

 % list-id-localities [options] [query]

DESCRIPTION

REPLACE ME

OPTIONS

* marks required options.

Configuration options

--config-path=filename

Set path to configuration file.

Can be specified multiple times.

--config-profile=s

Set configuration profile to use.

--no-config

Do not use any configuration file.

Environment options

--no-env

Do not read environment for default 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:

 ["ind_name"]

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 bps_code options

--bps-code-in-json=s

Only return records where the 'bps_code' field is in the specified values (JSON-encoded).

See --bps-code-in.

--bps-code-in=s@

Only return records where the 'bps_code' field is in the specified values.

Can be specified multiple times.

--bps-code-is=i

Only return records where the 'bps_code' field equals specified value.

--bps-code-isnt=i

Only return records where the 'bps_code' field does not equal specified value.

--bps-code-max=i

Only return records where the 'bps_code' field is less than or equal to specified value.

--bps-code-min=i

Only return records where the 'bps_code' field is greater than or equal to specified value.

--bps-code-not-in-json=s

Only return records where the 'bps_code' field is not in the specified values (JSON-encoded).

See --bps-code-not-in.

--bps-code-not-in=s@

Only return records where the 'bps_code' field is not in the specified values.

Can be specified multiple times.

--bps-code-xmax=i

Only return records where the 'bps_code' field is less than specified value.

--bps-code-xmin=i

Only return records where the 'bps_code' field is greater than specified value.

--bps-code=i

Only return records where the 'bps_code' field equals specified value.

Filtering for bps_prov_code options

--bps-prov-code-in-json=s

Only return records where the 'bps_prov_code' field is in the specified values (JSON-encoded).

See --bps-prov-code-in.

--bps-prov-code-in=s@

Only return records where the 'bps_prov_code' field is in the specified values.

Can be specified multiple times.

--bps-prov-code-is=i

Only return records where the 'bps_prov_code' field equals specified value.

--bps-prov-code-isnt=i

Only return records where the 'bps_prov_code' field does not equal specified value.

--bps-prov-code-max=i

Only return records where the 'bps_prov_code' field is less than or equal to specified value.

--bps-prov-code-min=i

Only return records where the 'bps_prov_code' field is greater than or equal to specified value.

--bps-prov-code-not-in-json=s

Only return records where the 'bps_prov_code' field is not in the specified values (JSON-encoded).

See --bps-prov-code-not-in.

--bps-prov-code-not-in=s@

Only return records where the 'bps_prov_code' field is not in the specified values.

Can be specified multiple times.

--bps-prov-code-xmax=i

Only return records where the 'bps_prov_code' field is less than specified value.

--bps-prov-code-xmin=i

Only return records where the 'bps_prov_code' field is greater than specified value.

--bps-prov-code=i

Only return records where the 'bps_prov_code' field equals specified value.

Filtering for ind_name options

--ind-name-contains=s

Only return records where the 'ind_name' field contains specified text.

--ind-name-in-json=s

Only return records where the 'ind_name' field is in the specified values (JSON-encoded).

See --ind-name-in.

--ind-name-in=s@

Only return records where the 'ind_name' field is in the specified values.

Can be specified multiple times.

--ind-name-is=s

Only return records where the 'ind_name' field equals specified value.

--ind-name-isnt=s

Only return records where the 'ind_name' field does not equal specified value.

--ind-name-max=s

Only return records where the 'ind_name' field is less than or equal to specified value.

--ind-name-min=s

Only return records where the 'ind_name' field is greater than or equal to specified value.

--ind-name-not-contains=s

Only return records where the 'ind_name' field does not contain specified text.

--ind-name-not-in-json=s

Only return records where the 'ind_name' field is not in the specified values (JSON-encoded).

See --ind-name-not-in.

--ind-name-not-in=s@

Only return records where the 'ind_name' field is not in the specified values.

Can be specified multiple times.

--ind-name-xmax=s

Only return records where the 'ind_name' field is less than specified value.

--ind-name-xmin=s

Only return records where the 'ind_name' field is greater than specified value.

--ind-name=s

Only return records where the 'ind_name' field equals specified value.

Filtering for type options

--type-in-json=s

Only return records where the 'type' field is in the specified values (JSON-encoded).

See --type-in.

--type-in=s@

Only return records where the 'type' field is in the specified values.

Can be specified multiple times.

--type-is=i

Only return records where the 'type' field equals specified value.

--type-isnt=i

Only return records where the 'type' field does not equal specified value.

--type-max=i

Only return records where the 'type' field is less than or equal to specified value.

--type-min=i

Only return records where the 'type' field is greater than or equal to specified value.

--type-not-in-json=s

Only return records where the 'type' field is not in the specified values (JSON-encoded).

See --type-not-in.

--type-not-in=s@

Only return records where the 'type' field is not in the specified values.

Can be specified multiple times.

--type-xmax=i

Only return records where the 'type' field is less than specified value.

--type-xmin=i

Only return records where the 'type' field is greater than specified value.

--type=i

Only return records where the 'type' field equals specified value.

Filtering options

--query=s, -q

Search.

Ordering options

--random

Return records in random order.

--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.

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=i

Only return a certain number of records.

--result-start=i

Only return starting from the n'th record.

Default value:

 1

Other options

--help, -h, -?

Display help message and exit.

--version, -v

Display program's version and exit.

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-localities list-id-localities

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 shcompgen which allows you to activate completion scripts for several kinds of scripts on multiple shells. Some CPAN distributions (those that are built with Dist::Zilla::Plugin::GenShellCompletion) will even automatically enable shell completion for their included scripts (using shcompgen) at installation time, so you can immadiately have tab completion.

tcsh

To activate tcsh completion for this script, put:

 complete list-id-localities 'p/*/`list-id-localities`/'

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.

ENVIRONMENT

  • LIST_ID_LOCALITIES_OPT

    Specify additional command-line options

CONFIGURATION FILE

This script can read configuration file, which by default is searched at ~/.config/list-id-localities.conf, ~/list-id-localities.conf or /etc/list-id-localities.conf (can be changed by specifying --config-path). All found files will be read and merged.

To disable searching for configuration files, pass --no-config.

Configuration file is in the format of IOD, which is basically INI with some extra features.

You can put multiple profiles in a single file by using section names like [profile=SOMENAME]. Those sections will only be read if you specify the matching --config-profile SOMENAME.

List of available configuration parameters:

 bps_code (see --bps-code)
 bps_code.in (see --bps-code-in)
 bps_code.is (see --bps-code-is)
 bps_code.isnt (see --bps-code-isnt)
 bps_code.max (see --bps-code-max)
 bps_code.min (see --bps-code-min)
 bps_code.not_in (see --bps-code-not-in)
 bps_code.xmax (see --bps-code-xmax)
 bps_code.xmin (see --bps-code-xmin)
 bps_prov_code (see --bps-prov-code)
 bps_prov_code.in (see --bps-prov-code-in)
 bps_prov_code.is (see --bps-prov-code-is)
 bps_prov_code.isnt (see --bps-prov-code-isnt)
 bps_prov_code.max (see --bps-prov-code-max)
 bps_prov_code.min (see --bps-prov-code-min)
 bps_prov_code.not_in (see --bps-prov-code-not-in)
 bps_prov_code.xmax (see --bps-prov-code-xmax)
 bps_prov_code.xmin (see --bps-prov-code-xmin)
 detail (see --detail)
 fields (see --field)
 format (see --format)
 ind_name (see --ind-name)
 ind_name.contains (see --ind-name-contains)
 ind_name.in (see --ind-name-in)
 ind_name.is (see --ind-name-is)
 ind_name.isnt (see --ind-name-isnt)
 ind_name.max (see --ind-name-max)
 ind_name.min (see --ind-name-min)
 ind_name.not_contains (see --ind-name-not-contains)
 ind_name.not_in (see --ind-name-not-in)
 ind_name.xmax (see --ind-name-xmax)
 ind_name.xmin (see --ind-name-xmin)
 naked_res (see --naked-res)
 query (see --query)
 random (see --random)
 result_limit (see --result-limit)
 result_start (see --result-start)
 sort (see --sort)
 type (see --type)
 type.in (see --type-in)
 type.is (see --type-is)
 type.isnt (see --type-isnt)
 type.max (see --type-max)
 type.min (see --type-min)
 type.not_in (see --type-not-in)
 type.xmax (see --type-xmax)
 type.xmin (see --type-xmin)
 with_field_names (see --with-field-names)

FILES

~/.config/list-id-localities.conf

~/list-id-localities.conf

/etc/list-id-localities.conf

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/App-IndonesianLocaleUtils.

SOURCE

Source repository is at https://github.com/perlancar/perl-App-IndonesianLocaleUtils.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-IndonesianLocaleUtils

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) 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.