« Sah/Schema/perl/sorter/modname_with_optional_args.pm
↑ Summary
Sah/Schema/perl/sorter/modnames_with_optional_args.pm »
| 1 | package Sah::Schema::perl::sorter::modnames; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |
| 6 | 1 | our $DATE = '2024-01-23'; # DATE | |
| 7 | 1 | our $DIST = 'Sah-Schemas-Sorter'; # DIST | |
| 8 | 1 | our $VERSION = '0.001'; # VERSION | |
| 9 | |||
| 10 | 1 | our $schema = [array => { | |
| 11 | summary => 'Array of Perl Sorter::* module names without the prefix, e.g. ["Foo::bar", "Foo::baz"]', | ||
| 12 | description => <<'_', | ||
| 13 | |||
| 14 | Array of Perl Sorter::* module names, where each element is of | ||
| 15 | `perl::sorter::modname` schema, e.g. `Foo::bar`, `Foo::baz`. | ||
| 16 | |||
| 17 | Contains coercion rule that expands wildcard, so you can specify: | ||
| 18 | |||
| 19 | Foo::* | ||
| 20 | |||
| 21 | and it will be expanded to e.g.: | ||
| 22 | |||
| 23 | ["Foo::bar", "Foo::baz"] | ||
| 24 | |||
| 25 | The wildcard syntax supports jokers (`?`, `*`, `**`), brackets (`[abc]`), and | ||
| 26 | braces (`{one,two}`). See <pm:Module::List::Wildcard> for more details. | ||
| 27 | |||
| 28 | _ | ||
| 29 | of => ["perl::sorter::modname", {req=>1}], | ||
| 30 | |||
| 31 | 'x.perl.coerce_rules' => [ | ||
| 32 | ['From_str_or_array::expand_perl_modname_wildcard', {ns_prefix=>'Sorter'}], | ||
| 33 | ], | ||
| 34 | |||
| 35 | # provide a default completion which is from list of installed perl modules | ||
| 36 | 'x.element_completion' => ['perl_modname', {ns_prefix=>'Sorter'}], | ||
| 37 | |||
| 38 | }]; | ||
| 39 | |||
| 40 | 1 | 1; | |
| 41 | # ABSTRACT: | ||
| 42 | |||
| 43 | __END__ | ||