App-Unliner
view release on metacpan or search on metacpan
bin/unliner view on Meta::CPAN
#!/usr/bin/env perl
use common::sense;
use App::Unliner::Program;
my $filename = shift @ARGV;
if (!defined $filename || $filename eq '-') {
$filename = \*STDIN;
}
if ($filename eq '-h' || $filename eq '-?' || $filename eq '--help') {
display_help();
}
App::Unliner::Program->new
->compile_file($filename)
->run( def_name => 'main', argv => \@ARGV, );
sub display_help {
require Pod::Perldoc;
@ARGV = ('-F', $0);
Pod::Perldoc->run();
exit 0;
}
__END__
=pod
=encoding utf-8
=head1 NAME
unliner - Untangle your unix pipeline one-liners
=head1 USAGE
Unliner is a scripting language and toolset for refactoring and developing unix one-liners.
This is the command line interface for running unliner scripts. To learn how to create unliner scripts, see L<App::Unliner::Intro>.
You can run your scripts by passing them in as the first argument to C<unliner>:
unliner /path/to/myscript.unliner [args to unliner script]
Alternatively, you can put the following line at the top of your unliner script:
#!/usr/bin/env unliner
make your script executable:
chmod a+x /path/to/myscript.unliner
and then run it directly:
/path/to/myscript.unliner [args]
Lastly, you pipe an unliner script to C<unliner> on standard input:
unliner < /path/to/myscript.unliner
although now your unliner script won't have standard input available to it which your script may require.
=head1 DEBUGGING
If you set the environment variable C<UNLINER_DEBUG> then some extra information will be printed to stderr (see L<App::Unliner::Intro>):
UNLINER_DEBUG=1 /path/to/myscript.unliner
=head1 SEE ALSO
L<App::Unliner::Intro>
L<unliner github repo|https://github.com/hoytech/unliner>
=head1 AUTHOR
Doug Hoyte, C<< <doug@hcsw.org> >>
=head1 COPYRIGHT & LICENSE
Copyright 2012-2014 Doug Hoyte.
This module is licensed under the same terms as perl itself.
=cut
( run in 1.215 second using v1.01-cache-2.11-cpan-d8267643d1d )