/usr/local/bin
NameSizeModeActions
config_data71380555editdlrm
crc3210430555editdlrm
crontab33207360755editdlrm
drush61386460755editdlrm
drush.phar61386460755editdlrm
ea-php7258154000755editdlrm
ea-php7356472880755editdlrm
ea-php7463832960755editdlrm
ea-php8079860800755editdlrm
ea-php8180989520755editdlrm
ea_convert_php_ini408110755editdlrm
ea_current_to_profile115190755editdlrm
ea_install_profile72740755editdlrm
ea_sync_user_phpini_settings68880755editdlrm
htmltree11730555editdlrm
instmodsh41940555editdlrm
ipcount37240555editdlrm
iptab9820555editdlrm
json_pp38280555editdlrm
json_xs70130555editdlrm
lsphp9370755editdlrm
lwp-download86350555editdlrm
lwp-dump27970555editdlrm
lwp-mirror24780555editdlrm
lwp-request150590555editdlrm
mech-dump46230555editdlrm
passwd37686640755editdlrm
pear9350755editdlrm
php9330755editdlrm
php-config63840755editdlrm
prove134570555editdlrm
ptar34560555editdlrm
ptardiff25350555editdlrm
ptargrep42990555editdlrm
shasum92870555editdlrm
tpage89230555editdlrm
ttree392340555editdlrm
wp69284610755editdlrm
wp-cli.phar69284610755editdlrm
zipdetails483660555editdlrm
Edit: /usr/local/bin/tpage (8923B)
#!/usr/bin/perl -w eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}' if 0; # not running under some shell #======================================================================== # # tpage # # DESCRIPTION # Script for processing and rendering a template document using the # Perl Template Toolkit. # # AUTHOR # Andy Wardley # # COPYRIGHT # Copyright (C) 1996-2000 Andy Wardley. All Rights Reserved. # Copyright (C) 1998-2000 Canon Research Centre Europe Ltd. # # This module is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # #------------------------------------------------------------------------ # # $Id$ # #======================================================================== use strict; use Template; use Template::Directive; use AppConfig; my $NAME = "tpage"; my $VERSION = 2.70; my $HOME = $ENV{ HOME } || ''; my $RCFILE = $ENV{"\U${NAME}rc"} || "$HOME/.${NAME}rc"; my $TTMODULE = 'Template'; # read .tpagerc file and any command line arguments my $config = read_config($RCFILE); # unshift any perl5lib directories onto front of INC unshift(@INC, @{ $config->perl5lib }); # get all template_directive_* options from the config my %ttdirectiveopts = $config->varlist('^template_directive_', 1); # get all template_* (except template_directive_*) options from the config and fold keys to UPPER CASE my %ttopts = $config->varlist('^template_(?!directive_)', 1); my $ttmodule = delete($ttopts{ module }); my $ucttopts = { map { my $v = $ttopts{ $_ }; defined $v ? (uc $_, $v) : () } keys %ttopts, }; # load custom template module if ($ttmodule) { my $ttpkg = $ttmodule; $ttpkg =~ s[::][/]g; $ttpkg .= '.pm'; require $ttpkg; } else { $ttmodule = $TTMODULE; } # load custom Template::Directive configuration map { my $v = $ttdirectiveopts{ $_ }; if( defined $v ) { ${ $Template::Directive::{ uc $_ } } = $ttdirectiveopts{ $_ } } } keys %ttdirectiveopts; # add current directory to INCLUDE_PATH unshift(@{ $ucttopts->{ INCLUDE_PATH } }, '.'); # read from STDIN if no files specified push(@ARGV, '-') unless @ARGV; my $template = $ttmodule->new($ucttopts) || die $ttmodule->error(); # process each input file foreach my $file (@ARGV) { $file = \*STDIN if $file eq '-'; $template->process($file) || die $template->error(); } sub read_config { my $file = shift; my $config = AppConfig->new( { ERROR => sub { die(@_, "\ntry `$NAME --help'\n") } }, 'help|h' => { ACTION => \&help }, 'template_absolute|absolute' => { DEFAULT => 1 }, 'template_relative|relative' => { DEFAULT => 1 }, 'template_module|module=s', 'template_anycase|anycase', 'template_eval_perl|eval_perl', 'template_load_perl|load_perl', 'template_interpolate|interpolate', 'template_pre_chomp|pre_chomp|prechomp', 'template_post_chomp|post_chomp|postchomp', 'template_trim|trim', 'template_variables|variables|define=s%', 'template_include_path|include_path|include|I=s@', 'template_pre_process|pre_process|preprocess=s@', 'template_post_process|post_process|postprocess=s@', 'template_process|process=s', 'template_wrapper|wrapper=s', 'template_recursion|recursion', 'template_expose_blocks|expose_blocks', 'template_default|default=s', 'template_error|error=s', 'template_debug|debug=s', 'template_start_tag|start_tag|starttag=s', 'template_end_tag|end_tag|endtag=s', 'template_tag_style|tag_style|tagstyle=s', 'template_compile_ext|compile_ext=s', 'template_compile_dir|compile_dir=s', 'template_plugin_base|plugin_base|pluginbase=s@', 'perl5lib|perllib=s@', 'template_directive_debug', 'template_directive_pretty', 'template_directive_while_max|while_max=i' ); # add the 'file' option now that we have a $config object that we # can reference in a closure $config->define( 'file|f=s@' => { EXPAND => AppConfig::EXPAND_ALL, ACTION => sub { my ($state, $item, $file) = @_; $file = $state->cfg . "/$file" unless $file =~ /^[\.\/]|(?:\w:)/; $config->file($file) } } ); # process main config file, then command line args $config->file($file) if -f $file; $config->args(); return $config; } sub help { print< script is a simple wrapper around the Template Toolkit processor. Files specified by name on the command line are processed in turn by the template processor and the resulting output is sent to STDOUT and can be redirected accordingly. e.g. tpage myfile > myfile.out tpage header myfile footer > myfile.html If no file names are specified on the command line then B will read STDIN for input. The C<--define> option can be used to set the values of template variables. e.g. tpage --define author="Andy Wardley" skeleton.pm > MyModule.pm =head2 The F<.tpagerc> Configuration File You can use a F<.tpagerc> file in your home directory. The purpose of this file is to set any I configuration options that you want applied I time F is run. For example, you can use the C to use template files from a generic template directory. Run C for a summary of the options available. See L