Add --use option to use extra modules when tracing
[p5sagit/App-FatPacker.git] / bin / fatpack
CommitLineData
a5e340ba 1#!/usr/bin/env perl
2
3use App::FatPacker -run_script;
4
5=head1 NAME
6
7fatpack - Command line frontend for App::FatPacker
8
9=head1 COMMANDS
10
11=head2 trace
12
3fdf85ca 13 $ fatpack trace [--to=trace-file|--to-stderr] [--use=MODULE]
14 myscript.pl
a5e340ba 15
16Compiles myscript.pl (as in "perl -c") and writes out a trace file containing
17every module require()d during the compilation.
18
19The trace file is called 'fatpacker.trace' by default; the --to option
20overrides this.
21
22If you pass --to-stderr fatpack writes the trace to STDERR instead.
23
24You cannot pass both --to and --to-stderr.
25
3fdf85ca 26If the --use option specifies a module (or modules, if used multiple
27times) those modules will be additionally included in the trace output.
28
a5e340ba 29=head2 packlists-for
30
31 $ fatpack packlists-for Module1 Module2 Module3
32
33Searches your perl's @INC for .packlist files containing the .pm files for
34the modules requested and emits a list of unique packlist files to STDOUT.
35
36These packlists will, in a pure cpan-installation environment, be all non-core
37distributions required for those modules.
38
39Unfortunately most vendors strip the .packlist files so if you installed
40modules via e.g. apt-get you may be missing those modules; installing your
41dependencies into a L<local::lib|local::lib> first is the preferred workaround.
42
43=head2 tree
44
45 $ fatpack tree fatlib packlist1 packlist2 packlist3
46
47Takes a list of packlist files and copies their contents into a tree at the
48requested location.
49
50This tree should be sufficient to 'use lib' to make available all modules
51provided by the distributions whose packlists were specified.
52
53=head2 file
54
55 $ fatpack file
56
57Recurses into the 'lib' and 'fatlib' directories and bundles all .pm files
58found into a BEGIN block which adds a virtual @INC entry to load these files
59from the bundled code rather than disk.
60
61=head1 RECIPES
62
63Current basic recipe for packing:
64
65 $ fatpack trace myscript.pl
a884f0d7 66 $ fatpack packlists-for `cat fatpacker.trace` >packlists
67 $ fatpack tree `cat packlists`
a5e340ba 68 $ (fatpack file; cat myscript.pl) >myscript.packed.pl
69
70=head1 COPYRIGHT, LICENSE, AUTHOR
71
72See the corresponding sections in L<App::FatPacker>.
73
74=cut