| 1 | package Getopt::EX::Factotum; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use v5.16; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use IO::Factotum; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | # -MFactotum::load=NAME calls load(NAME => 1): the converter of | ||||||||||
| 9 | # IO::Factotum::NAME is registered. ARGV is not tied here; the | ||||||||||
| 10 | # program opens its files by IO::Factotum::open_input. | ||||||||||
| 11 | 0 | ▶ | sub load { | ||||||||
|
Subroutine
load: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 12 | 0 | my @names; | |||||||||
| 13 | 0 | ▶ | while (my($name, $val) = splice @_, 0, 2) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 0 | ▶ | push @names, $name if $val; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | } | ||||||||||
| 16 | 0 | IO::Factotum::load(@names); | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | 1 | 1; | |||||||||
| 20 | |||||||||||
| 21 | =encoding utf-8 | ||||||||||
| 22 | |||||||||||
| 23 | =head1 NAME | ||||||||||
| 24 | |||||||||||
| 25 | Getopt::EX::Factotum - Getopt::EX module to load IO::Factotum converters | ||||||||||
| 26 | |||||||||||
| 27 | =head1 SYNOPSIS | ||||||||||
| 28 | |||||||||||
| 29 | ansicolumn -MFactotum::load=Highlight::skylighting file.c file.h | ||||||||||
| 30 | |||||||||||
| 31 | =head1 DESCRIPTION | ||||||||||
| 32 | |||||||||||
| 33 | This is a module of L<Getopt::EX> for the commands which open their | ||||||||||
| 34 | files by C<IO::Factotum::open_input>. | ||||||||||
| 35 | |||||||||||
| 36 | Note that L<optex|App::optex> takes a C<-M> option after the command | ||||||||||
| 37 | name as its own module, when it can load it. L<ansicolumn|App::ansicolumn> | ||||||||||
| 38 | has the C<--factotum> option, which does the same and is not taken. | ||||||||||
| 39 | |||||||||||
| 40 | =over 4 | ||||||||||
| 41 | |||||||||||
| 42 | =item B<load>=I<name> | ||||||||||
| 43 | |||||||||||
| 44 | Register the converter of C<IO::Factotum::>I<name> | ||||||||||
| 45 | (C<IO::Factotum::load>). | ||||||||||
| 46 | |||||||||||
| 47 | =back | ||||||||||
| 48 | |||||||||||
| 49 | =head1 SEE ALSO | ||||||||||
| 50 | |||||||||||
| 51 | L<IO::Factotum>, L<IO::Factotum::Highlight::skylighting>, L<Getopt::EX> | ||||||||||
| 52 | |||||||||||
| 53 | =cut | ||||||||||
| 54 | |||||||||||
| 55 | __DATA__ | ||||||||||