App-Pipeline-Simple
view release on metacpan or search on metacpan
#!/usr/bin/env perl
use App::Pipeline::Simple;
use Getopt::Long;
use Carp;
use strict;
use warnings;
use constant PROGRAMME_NAME => 'spipe';
# ABSTRACT: simple pipeline running interface
our $VERSION = '0.9.1'; # VERSION
# PODNAME: spipe
# raising $OUTPUT_AUTOFLUSH flag to get immediate reporting
$| = 1;
# catch interuptions cleanly
$SIG{'INT'} = 'CLEANUP';
sub CLEANUP { exit(1) }
# variables to catch command line options
our $DEBUG = '';
our $CONFIG = '';
our $DIR = '.';
our $GRAPHVIZ;
our $INPUT = '';
our $ITYPE = '';
#our $CONTINUE; # not implemented yet
our $START = '';
our $STOP = '';
our $VERBOSE;
GetOptions(
'v|version' => sub{ print PROGRAMME_NAME, ", version ", $VERSION, "\n";
exit(1); },
'g|debug' => \$DEBUG,
'c|config:s' => \$CONFIG,
'd|directory:s' => \$DIR,
'i|input:s' => \$INPUT,
'it|itype:s' => \$ITYPE,
'graphviz' => \$GRAPHVIZ,
# 'continue' => \$CONTINUE,
'start:s' => \$START,
'stop:s' => \$STOP,
'verbose:i' => \$VERBOSE,
'h|help|?' => sub{ exec('perldoc',$0); exit(0) },
);
my %args;
$args{config} = $CONFIG if $CONFIG;
$args{dir} = $DIR;
$args{input} = $INPUT if $INPUT;
$args{itype} = $ITYPE if $ITYPE;
$args{start} = $START if $START;
$args{stop} = $STOP if $STOP;
$args{verbose} = $VERBOSE if $VERBOSE;
unless (-e "$DIR/config.yml" or $CONFIG ) {
croak "ERROR: Need either explicit config file or ".
"it has to be found the working directory\n"
}
my $p = App::Pipeline::Simple->new(%args);
print $p->graphviz and exit if $GRAPHVIZ;
print $p->stringify and exit if $DEBUG;
$p->run();
__END__
=pod
=head1 NAME
spipe - simple pipeline running interface
=head1 VERSION
version 0.9.1
=head1 SYNOPSIS
B<spipe> [B<--version> | [B<-?|-h|--help>] | [B<-g|--debug>] |
B<[--graphviz> | B<[-c|--config> file | [B<[-d|--directory> value] |
B<[-i|--input> string| B<[-it|--itype> string |
[B<[--start> value] | [B<[--stop> value]
spipe -config t/data/string_manipulation.yml -d /tmp/test
=head1 DESCRIPTION
Spipe is a control script for running simple pipelines read from
configuration files written in YAML language.
For internal details of the pipeline, check the documentation for the
perl module L<App::Pipeline::Simple>.
=head1 NAME
spipe - simple pipeline running interface
=head1 OPTIONS
=over 7
=item B<-v | --version>
Print out a line with the program name and version number.
=item B<-? | -h | --help>
Show this help.
( run in 0.893 second using v1.01-cache-2.11-cpan-39bf76dae61 )