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

NAME

list-sah-schema-modules - List Sah coerce rule modules

VERSION

This document describes version 0.483 of list-sah-schema-modules (from Perl distribution App-SahUtils), released on 2023-01-20.

SYNOPSIS

list-sah-schema-modules --help (or -h, -?)

list-sah-schema-modules --version (or -v)

list-sah-schema-modules [--config-path=path|-c|--no-config|-C] [--config-profile=profile|-P] [--detail|-l|--no-detail|--nodetail] [--dist-contains=str] [(--dist-in=str)+|--dist-in-json=json] [--dist-is=str] [--dist-isnt=str] [--dist-max=str] [--dist-min=str] [--dist-not-contains=str] [(--dist-not-in=str)+|--dist-not-in-json=json] [--dist-xmax=str] [--dist-xmin=str] [--dist=str] [(--exclude-field=str)+|--exclude-fields-json=json] [(--field=str)+|--fields-json=json] [--format=name|--json] [--might-fail|--no-might-fail|--nomight-fail] [--might-fail-is|--no-might-fail-is|--nomight-fail-is] [--might-fail-isnt|--no-might-fail-isnt|--nomight-fail-isnt] [--(no)naked-res] [--no-env] [--page-result[=program]|--view-result[=program]] [(--prio-in=int)+|--prio-in-json=json] [--prio-is=int] [--prio-isnt=int] [--prio-max=int] [--prio-min=int] [(--prio-not-in=int)+|--prio-not-in-json=json] [--prio-xmax=int] [--prio-xmin=int] [--prio=int] [--query-boolean=str|--and|--or] [(--query=str)+|--queries-json=json|(-q=str)+] [--random|--no-random|--norandom] [--result-limit=int] [--result-start=int] [--rule-contains=str] [(--rule-in=str)+|--rule-in-json=json] [--rule-is=str] [--rule-isnt=str] [--rule-max=str] [--rule-min=str] [--rule-not-contains=str] [(--rule-not-in=str)+|--rule-not-in-json=json] [--rule-xmax=str] [--rule-xmin=str] [--rule=str] [(--sort=str)+|--sort-json=json] [--summary-contains=str] [(--summary-in=str)+|--summary-in-json=json] [--summary-is=str] [--summary-isnt=str] [--summary-max=str] [--summary-min=str] [--summary-not-contains=str] [(--summary-not-in=str)+|--summary-not-in-json=json] [--summary-xmax=str] [--summary-xmin=str] [--summary=str] [--v-arg=str] [--v-contains=str] [(--v-in=str)+|--v-in-json=json] [--v-is=str] [--v-isnt=str] [--v-max=str] [--v-min=str] [--v-not-contains=str] [(--v-not-in=str)+|--v-not-in-json=json] [--v-xmax=str] [--v-xmin=str] [--with-field-names|--without-field-names] -- [query] ...

DESCRIPTION

REPLACE ME

OPTIONS

* marks required options.

Configuration options

--config-path=s, -c

Set path to configuration file.

Can actually be specified multiple times to instruct application to read from multiple configuration files (and merge them).

--config-profile=s, -P

Set configuration profile to use.

A single configuration file can contain profiles, i.e. alternative sets of values that can be selected. For example:

 [profile=dev]
 username=foo
 pass=beaver
 
 [profile=production]
 username=bar
 pass=honey

When you specify --config-profile=dev, username will be set to foo and password to beaver. When you specify --config-profile=production, username will be set to bar and password to honey.

--no-config, -C

Do not use any configuration file.

If you specify --no-config, the application will not read any configuration file.

Environment options

--no-env

Do not read environment for default options.

If you specify --no-env, the application wil not read any environment variable.

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.

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

--dist-contains=s

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

--dist-in-json=s

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

See --dist-in.

--dist-in=s@

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

Can be specified multiple times.

--dist-is=s

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

--dist-isnt=s

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

--dist-max=s

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

--dist-min=s

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

--dist-not-contains=s

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

--dist-not-in-json=s

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

See --dist-not-in.

--dist-not-in=s@

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

Can be specified multiple times.

--dist-xmax=s

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

--dist-xmin=s

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

--dist=s

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

Filtering for might_fail options

--might-fail

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

--might-fail-is

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

--might-fail-isnt

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

Filtering for prio options

--prio-in-json=s

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

See --prio-in.

--prio-in=s@

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

Can be specified multiple times.

--prio-is=s

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

--prio-isnt=s

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

--prio-max=s

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

--prio-min=s

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

--prio-not-in-json=s

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

See --prio-not-in.

--prio-not-in=s@

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

Can be specified multiple times.

--prio-xmax=s

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

--prio-xmin=s

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

--prio=s

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

Filtering for rule options

--rule-contains=s

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

--rule-in-json=s

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

See --rule-in.

--rule-in=s@

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

Can be specified multiple times.

--rule-is=s

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

--rule-isnt=s

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

--rule-max=s

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

--rule-min=s

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

--rule-not-contains=s

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

--rule-not-in-json=s

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

See --rule-not-in.

--rule-not-in=s@

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

Can be specified multiple times.

--rule-xmax=s

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

--rule-xmin=s

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

--rule=s

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

Filtering for summary options

--summary-contains=s

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

--summary-in-json=s

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

See --summary-in.

--summary-in=s@

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

Can be specified multiple times.

--summary-is=s

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

--summary-isnt=s

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

--summary-max=s

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

--summary-min=s

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

--summary-not-contains=s

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

--summary-not-in-json=s

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

See --summary-not-in.

--summary-not-in=s@

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

Can be specified multiple times.

--summary-xmax=s

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

--summary-xmin=s

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

--summary=s

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

Filtering for v options

--v-arg=s

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

--v-contains=s

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

--v-in-json=s

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

See --v-in.

--v-in=s@

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

Can be specified multiple times.

--v-is=s

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

--v-isnt=s

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

--v-max=s

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

--v-min=s

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

--v-not-contains=s

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

--v-not-in-json=s

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

See --v-not-in.

--v-not-in=s@

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

Can be specified multiple times.

--v-xmax=s

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

--v-xmin=s

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

Filtering options

--and

Shortcut for --query-boolean=and.

See --query-boolean.

--or

Shortcut for --query-boolean=or.

See --query-boolean.

--queries-json=s, -q

Search (JSON-encoded).

See --query.

Can also be specified as the 1st command-line argument and onwards.

--query-boolean=s

Whether records must match all search queries ('and') or just one ('or').

Default value:

 "and"

Valid values:

 ["and","or"]

If set to and, all queries must match; if set to or, only one query should match. See the queries option for more details on searching.

--query=s@

Search.

This will search all searchable fields with one or more specified queries. Each query can be in the form of -FOO (dash prefix notation) to require that the fields do not contain specified string, or /FOO/ to use regular expression. All queries must match if the query_boolean option is set to and; only one query should match if the query_boolean option is set to or.

Can also be specified as the 1st command-line argument and onwards.

Can be specified multiple times.

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

Output can be displayed in multiple formats, and a suitable default format is chosen depending on the application and/or whether output destination is interactive terminal (i.e. whether output is piped). This option specifically chooses an output format.

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

This option will pipe the output to a specified pager program. If pager program is not specified, a suitable default e.g. less is chosen.

--view-result

View output using a viewer.

This option will first save the output to a temporary file, then open a viewer program to view the temporary file. If a viewer program is not chosen, a suitable default, e.g. the browser, is chosen.

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

--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-sah-schema-modules list-sah-schema-modules

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-sah-schema-modules 'p/*/`list-sah-schema-modules`/'

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): /home/u1/.config/list-sah-schema-modules.conf, /home/u1/list-sah-schema-modules.conf, or /etc/list-sah-schema-modules.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)
 dist (see --dist)
 dist.contains (see --dist-contains)
 dist.in (see --dist-in)
 dist.is (see --dist-is)
 dist.isnt (see --dist-isnt)
 dist.max (see --dist-max)
 dist.min (see --dist-min)
 dist.not_contains (see --dist-not-contains)
 dist.not_in (see --dist-not-in)
 dist.xmax (see --dist-xmax)
 dist.xmin (see --dist-xmin)
 exclude_fields (see --exclude-field)
 fields (see --field)
 format (see --format)
 might_fail (see --might-fail)
 might_fail.is (see --might-fail-is)
 might_fail.isnt (see --might-fail-isnt)
 naked_res (see --naked-res)
 prio (see --prio)
 prio.in (see --prio-in)
 prio.is (see --prio-is)
 prio.isnt (see --prio-isnt)
 prio.max (see --prio-max)
 prio.min (see --prio-min)
 prio.not_in (see --prio-not-in)
 prio.xmax (see --prio-xmax)
 prio.xmin (see --prio-xmin)
 queries (see --query)
 query_boolean (see --query-boolean)
 random (see --random)
 result_limit (see --result-limit)
 result_start (see --result-start)
 rule (see --rule)
 rule.contains (see --rule-contains)
 rule.in (see --rule-in)
 rule.is (see --rule-is)
 rule.isnt (see --rule-isnt)
 rule.max (see --rule-max)
 rule.min (see --rule-min)
 rule.not_contains (see --rule-not-contains)
 rule.not_in (see --rule-not-in)
 rule.xmax (see --rule-xmax)
 rule.xmin (see --rule-xmin)
 sort (see --sort)
 summary (see --summary)
 summary.contains (see --summary-contains)
 summary.in (see --summary-in)
 summary.is (see --summary-is)
 summary.isnt (see --summary-isnt)
 summary.max (see --summary-max)
 summary.min (see --summary-min)
 summary.not_contains (see --summary-not-contains)
 summary.not_in (see --summary-not-in)
 summary.xmax (see --summary-xmax)
 summary.xmin (see --summary-xmin)
 v (see --v-arg)
 v.contains (see --v-contains)
 v.in (see --v-in)
 v.is (see --v-is)
 v.isnt (see --v-isnt)
 v.max (see --v-max)
 v.min (see --v-min)
 v.not_contains (see --v-not-contains)
 v.not_in (see --v-not-in)
 v.xmax (see --v-xmax)
 v.xmin (see --v-xmin)
 with_field_names (see --with-field-names)

ENVIRONMENT

LIST_SAH_SCHEMA_MODULES_OPT

String. Specify additional command-line options.

FILES

/home/u1/.config/list-sah-schema-modules.conf

/home/u1/list-sah-schema-modules.conf

/etc/list-sah-schema-modules.conf

HOMEPAGE

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

SOURCE

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

SEE ALSO

show-sah-schema-module

list-sah-schemas-modules

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, Pod::Weaver::PluginBundle::Author::PERLANCAR, and sometimes one or two other Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond that are considered a bug and can be reported to me.

COPYRIGHT AND LICENSE

This software is copyright (c) 2023, 2022, 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-SahUtils

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.