App-RecordStream

 view release on metacpan or  search on metacpan

lib/App/RecordStream/DBHandle.pm  view on Meta::CPAN


  return $DISPATCH_TABLE->{$type}->($options);
}

sub parse_options {
  my $options = shift;
  my $mode    = shift;
  my $args    = shift || \@ARGV;

  my $spec = get_option_spec($mode, $options);
  local @ARGV = @$args;

  my $saved_settings = Getopt::Long::Configure();
  Getopt::Long::Configure("pass_through");
  GetOptions( %$spec );
  Getopt::Long::Configure($saved_settings);

  set_defaults($mode, $options);

  @$args = @ARGV;
}

lib/App/RecordStream/Operation.pm  view on Meta::CPAN


  # Add filename annotation option
  $options_spec->{'--filename-key|fk=s'} = \($this->{'FILENAME_KEY'})
    if $this->does_record_output;

  my $starting_config = Getopt::Long::Configure();

  # Push custom configuration
  Getopt::Long::Configure('no_ignore_case', @$configuration_options);

  local @ARGV = @$args;
  unless (GetOptions(%$options_spec)) {
    # output usage if there was a problem with option parsing
    $this->_set_wants_help(1);
  }

  # Restore original configuration
  Getopt::Long::Configure($starting_config);

  @$args = @ARGV;
}

lib/App/RecordStream/Operation/chain.pm  view on Meta::CPAN

  if ( $this->{'DRY_RUN'} ) {
    return;
  }

  my $head = $this->{'CHAIN_HEAD'};

  if ( $head ) {
    my $head_operation = $head->[1];
    my $head_args = $head->[2];
    if ( $head_operation->wants_input() ) {
      local @ARGV = @$head_args;
      while(my $line = <>) {
        chomp $line;
        App::RecordStream::Operation::set_current_filename($ARGV);
        if ( ! $head_operation->accept_line($line) ) {
          last;
        }
      }
    }
    $head_operation->finish();
  }

lib/App/RecordStream/Operation/help.pm  view on Meta::CPAN

}

sub init {
  my $this = shift;
  my $args = shift;
  $this->parse_options($args, {});

  my $op = shift @$args;
  if ($op) {
    # Command help
    local @ARGV = ("--help");
    App::RecordStream::Operation::main("recs-$op");
  } else {
    # Option help
    $this->_set_wants_help(1);
  }
}

sub does_record_output { 0 }
sub wants_input { 0 }
sub accept_line {

lib/App/RecordStream/Operation/help/FromManual.pm  view on Meta::CPAN

package App::RecordStream::Operation::help::FromManual;
use base qw(App::RecordStream::Operation::help);

use Pod::Perldoc;
use File::Temp qw< tempfile >;
use Scalar::Util qw< blessed >;

sub init_help {}
sub init {
  my $this = shift;
  local @ARGV = ('-F', $this->pod_file);
  Pod::Perldoc->run();
}

sub pod_file {
  my $this = shift;
  my ($class, $pm) = $this->manual_class;
  my $source = $INC{$pm};

  # Simple case: manual class is on disk already
  if (not ref $source and -e $source) {

lib/App/RecordStream/Test/OperationHelper.pm  view on Meta::CPAN

    if ( ref($input) eq 'ARRAY' ) {
      my ($t, @v) = @$input;
      if ( $t eq 'LINES' ) {
        for my $l (@v) {
          if ( ! $op->accept_line($l) ) {
            last;
          }
        }
      }
      elsif ( $t eq 'FILES' ) {
        local @ARGV = @v;
        while(my $l = <>) {
          App::RecordStream::Operation::set_current_filename($ARGV);
          chomp $l;
          if ( ! $op->accept_line($l) ) {
            last;
          }
        }
      }
      else {
        die;

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.560 second using v1.00-cache-2.02-grep-82fe00e-cpan-da92000dfeb )