Group
Extension

Matches 3

Cron-Sequencer ( N/NW/NWCLARK/Cron-Sequencer-0.05.tar.gz, NWCLARK, 2022; MetaCPAN )
Cron-Sequencer/lib/Cron/Sequencer.pm ( view source; MetaCPAN )
er

=head1 SYNOPSIS

    my $crontab = Cron::Sequencer->new("/path/to/crontab");
    print encode_json([$crontab->sequence($start, $end)]);

=head1 DESCRIPTION

This class can take one or more crontab
Cron-Sequencer ( N/NW/NWCLARK/Cron-Sequencer-0.05.tar.gz, NWCLARK, 2022; MetaCPAN )
Cron-Sequencer/lib/Cron/Sequencer/CLI.pm ( view source; MetaCPAN )
arse_argv);

my %known_json = map { $_, 1 } qw(seq split pretty canonical);

sub parse_argv {
    my ($pod2usage, @argv) = @_;

    my @groups;
    my $current = [];
    my $json;

    # Split the com
) {
            push @groups, $current;
            $current = [];
        } elsif ($item =~ /\A--json(?:=(.*)|)\z/s && !@groups) {
            # GetOpt::Long doesn't appear to have a way to specify t
he '=' form.
            # We'd like to support `--json` and `--json=pretty` but have
            # `--json pretty` mean the same as `./pretty --json`

            if (length $1) {
                for
Cron-Sequencer ( N/NW/NWCLARK/Cron-Sequencer-0.05.tar.gz, NWCLARK, 2022; MetaCPAN )
Cron-Sequencer/lib/Cron/Sequencer/Output.pm ( view source; MetaCPAN )
 = %opts{qw(count group hide-env json)};

    return bless \%state;
}

sub render {
    my ($self, @groups) = @_;

    return $self->{json}
        ? $self->render_json(@groups) : $self->render_text(@
output;

    return join "\n", @output;
}

sub render_json {
    my ($self, @groups) = @_;
    require JSON::MaybeXS;

    my %opts = $self->{json}->%*;

    # CLI parser forbids 'seq' and 'split' sim
eq};
    my $start = $seq ? "\x1E" : "";
    my $split = delete $opts{split} || $seq;

    my $json = JSON::MaybeXS->new(%opts);

    my $munged;
    if ($self->{'hide-env'}) {
        # We shouldn't 

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.