NAME
App::fatten - Pack your dependencies onto your script file
VERSION
This document describes version 0.31 of App::fatten (from Perl distribution App-fatten), released on 2015-04-02.
SYNOPSIS
This distribution provides command-line utility called fatten.
TODO
FUNCTIONS
fatten(%args) -> [status, msg, result, meta]
Pack your dependencies onto your script file.
Arguments ('*' denotes required arguments):
args => array[str]
Script arguments.
Will be used when running your script, e.g. when
trace_method
isrequire
. For example, if your script requires three arguments:--foo
,2
,"bar baz"
then you can either use:% fatten script output --args --foo --args 2 --args "bar baz"
or:
% fatten script output --args-json '["--foo",2,"bar baz"]'
debug_keep_tempdir => bool (default: 0)
Keep temporary directory for debugging.
exclude => array[str]
Modules to exclude.
When you don't want to include a module, specify it here.
exclude_core => bool (default: 1)
Exclude core modules.
exclude_dist => array[str]
Exclude all modules of dist.
Just like the
exclude
option, but will exclude module as well as other modules from the same distribution. Module name must be the main module of the distribution. Will determine other modules from the.packlist
file.exclude_pattern => array[str]
Regex patterns of modules to exclude.
When you don't want to include a pattern of modules, specify it here.
include => array[str]
Include extra modules.
When the tracing process fails to include a required module, you can add it here.
include_dist => array[str]
Include all modules of dist.
Just like the
include
option, but will include module as well as other modules from the same distribution. Module name must be the main module of the distribution. Will determine other modules from the.packlist
file.include_from => array[str]
Include extra modules under directories.
input_file => str (default: "-")
Path to input file (script to be fatpacked).
-
(or if unspecified) means to take from standard input (internally, a temporary file will be created to handle this).output_file => str
Path to output file.
If input is from stdin, then output defaults to stdout. You can also specify stdout by using
-
.Otherwise, defaults to
<script>.fatpack
in source directory. If source directory happens to be unwritable by the script, will try<script>.fatpack
in current directory. If that fails too, will die.overwrite => bool (default: 0)
Whether to overwrite output if previously exists.
perl_version => str
Perl version to target, defaults to current running version.
This is for determining which modules are considered core and should be skipped by default (when
exclude_core
option is enabled). Different perl versions have different sets of core modules as well as different versions of the modules.shebang => str (default: "/usr/bin/perl")
Set shebang line/path.
squish => bool (default: 0)
Whether to squish included modules using Perl::Squish.
strip => bool (default: 0)
Whether to strip included modules using Perl::Strip.
stripper => bool (default: 0)
Whether to strip included modules using Perl::Stripper.
stripper_comment => bool (default: 1)
Set strip_comment=1 (strip comments) in Perl::Stripper.
Only relevant when stripping using Perl::Stripper.
stripper_log => bool (default: 0)
Set strip_log=1 (strip log statements) in Perl::Stripper.
Only relevant when stripping using Perl::Stripper.
stripper_maintain_linum => bool (default: 0)
Set maintain_linum=1 in Perl::Stripper.
Only relevant when stripping using Perl::Stripper.
stripper_pod => bool (default: 1)
Set strip_pod=1 (strip POD) in Perl::Stripper.
Only relevant when stripping using Perl::Stripper.
stripper_ws => bool (default: 1)
Set strip_ws=1 (strip whitespace) in Perl::Stripper.
Only relevant when stripping using Perl::Stripper.
trace_method => str (default: "fatpacker")
Which method to use to trace dependencies.
The default is
fatpacker
, which is the same as whatfatpack trace
does. Different tracing methods have different pro's and con's, one method might detect required modules that another method does not, and vice versa. There are several methods available, please seeApp::tracepm
for more details.A special value of
none
is also provided. If this is selected, then fatten will not perform any tracing. Usually used in conjunction with--include-from
.use => array[str]
Additional modules to "use".
Will be passed to the tracer. Will currently only affect the
fatpacker
andrequire
methods (because those methods actually run your script).
Returns an enveloped result (an array).
First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (result) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.
Return value: (any)
HOMEPAGE
Please visit the project's homepage at https://metacpan.org/release/App-fatten.
SOURCE
Source repository is at https://github.com/perlancar/perl-App-fatten.
BUGS
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-fatten
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.