App-TextTemplatePermuteUtils
view release on metacpan or search on metacpan
script/template-permute view on Meta::CPAN
#!perl
# Note: This script is a CLI for Riap function /App/TextTemplatePermuteUtils/template_permute
# and generated automatically using Perinci::CmdLine::Gen version 0.502
use 5.010001;
use strict;
use warnings;
use Perinci::CmdLine::Any;
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2026-02-22'; # DATE
our $DIST = 'App-TextTemplatePermuteUtils'; # DIST
our $VERSION = '0.002'; # VERSION
my $cmdline = Perinci::CmdLine::Any->new(
url => "/App/TextTemplatePermuteUtils/template_permute",
program_name => "template-permute",
);
$cmdline->run;
# ABSTRACT: Process a Text::Template::Permute template and output the results
# PODNAME: template-permute
__END__
=pod
=encoding UTF-8
=head1 NAME
template-permute - Process a Text::Template::Permute template and output the results
=head1 VERSION
This document describes version 0.002 of template-permute (from Perl distribution App-TextTemplatePermuteUtils), released on 2026-02-22.
=head1 SYNOPSIS
B<template-permute> B<L<--help|/"--help, -h, -?">> (or B<L<-h|/"--help, -h, -?">>, B<L<-?|/"--help, -h, -?">>)
B<template-permute> B<L<--version|/"--version, -v">> (or B<L<-v|/"--version, -v">>)
B<template-permute> [B<L<--array|/"--array, -a">>|B<L<-a|/"--array, -a">>|B<L<--no-array|/"--array, -a">>|B<L<--noarray|/"--array, -a">>] [B<L<--clipboard|/"-y">>=I<str>|B<L<-Y|/"-y">>|B<L<-y|/"-y">>] [B<L<--config-path|/"--config-path=s, -c">>=I<pat...
=head1 OPTIONS
C<*> marks required options.
=head2 Main options
=over
=item B<--array>, B<-a>
Return items as array, not as a single string.
=item B<--clipboard>=I<s>
Add items to clipboard.
Valid values:
["tee","only"]
=item B<--items>=I<s>, B<-n>
Only return this many items.
=item B<--separator>=I<s>, B<-s>
String to add as separator between items (only when not specifying --array).
=item B<--shuffle>, B<-r>
Shuffle/randomize order or results.
=item B<--template>=I<s>
The template string.
Can also be specified as the 1st command-line argument.
=item B<-y>
Shortcut for --clipboard=only.
See C<--clipboard>.
=item B<-Y>
Shortcut for --clipboard=tee.
See C<--clipboard>.
=back
=head2 Configuration options
=over
=item B<--config-path>=I<s>, B<-c>
Set path to configuration file.
Can actually be specified multiple times to instruct application to read from
multiple configuration files (and merge them).
=item B<--config-profile>=I<s>, B<-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 C<--config-profile=dev>, C<username> will be set to C<foo> and
C<password> to C<beaver>. When you specify C<--config-profile=production>,
C<username> will be set to C<bar> and C<password> to C<honey>.
=item B<--no-config>, B<-C>
Do not use any configuration file.
If you specify C<--no-config>, the application will not read any configuration
file.
=back
=head2 Environment options
=over
=item B<--no-env>
Do not read environment for default options.
If you specify C<--no-env>, the application wil not read any environment
variable.
=back
=head2 Output options
script/template-permute view on Meta::CPAN
complete -C template-permute template-permute
in your bash startup (e.g. F<~/.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 L<cpanm-shcompgen>
which can activate shell completion for scripts immediately.
=head2 tcsh
To activate tcsh completion for this script, put:
complete template-permute 'p/*/`template-permute`/'
in your tcsh startup (e.g. F<~/.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 L<shcompgen> (see above).
=head2 other shells
For fish and zsh, install L<shcompgen> as described above.
=head1 CONFIGURATION FILE
This script can read configuration files. Configuration files are in the format of L<IOD>, which is basically INI with some extra features.
By default, these names are searched for configuration filenames (can be changed using C<--config-path>): F</home/u1/.config/template-permute.conf>, F</home/u1/template-permute.conf>, or F</etc/template-permute.conf>.
All found files will be read and merged.
To disable searching for configuration files, pass C<--no-config>.
You can put multiple profiles in a single file by using section names like C<[profile=SOMENAME]> or C<[SOMESECTION profile=SOMENAME]>. Those sections will only be read if you specify the matching C<--config-profile SOMENAME>.
You can also put configuration for multiple programs inside a single file, and use filter C<program=NAME> in section names, e.g. C<[program=NAME ...]> or C<[SOMESECTION program=NAME]>. The section will then only be used when the reading program match...
You can also filter a section by environment variable using the filter C<env=CONDITION> in section names. For example if you only want a section to be read if a certain environment variable is true: C<[env=SOMEVAR ...]> or C<[SOMESECTION env=SOMEVAR ...
To load and configure plugins, you can use either the C<-plugins> parameter (e.g. C<< -plugins=DumpArgs >> or C<< -plugins=DumpArgs@before_validate_args >>), or use the C<[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 C<< -plugins=-DumpArgs@before_validate_args@99,-Foo@after_validate_args,arg1,val1,arg2,val2 >>.
List of available configuration parameters:
array (see --array)
clipboard (see --clipboard)
format (see --format)
items (see --items)
naked_res (see --naked-res)
separator (see --separator)
shuffle (see --shuffle)
template (see --template)
=head1 ENVIRONMENT
=head2 TEMPLATE_PERMUTE_OPT
String. Specify additional command-line options.
=head1 FILES
=head2 /home/u1/.config/template-permute.conf
=head2 /home/u1/template-permute.conf
=head2 /etc/template-permute.conf
=head1 HOMEPAGE
Please visit the project's homepage at L<https://metacpan.org/release/App-TextTemplatePermuteUtils>.
=head1 SOURCE
Source repository is at L<https://github.com/perlancar/perl-App-TextTemplatePermuteUtils>.
=head1 AUTHOR
perlancar <perlancar@cpan.org>
=head1 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 L<Dist::Zilla>,
L<Dist::Zilla::PluginBundle::Author::PERLANCAR>,
L<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.
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2026 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.
=head1 BUGS
( run in 2.551 seconds using v1.01-cache-2.11-cpan-2398b32b56e )