App-Multigit

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

    Scripts may also therefore change %BEHAVIOUR themselves, but it is
    probably badly behaved to do so.

  report_on_no_output

    Defaults to true; this should be used by scripts to determine whether
    to bother mentioning repositories that gave no output at all for the
    given task. If you use App::Multigit::Repo::report, this will be
    honoured by default.

    Controlled by the MG_REPORT_ON_NO_OUTPUT environment variable.

  ignore_stdout

  ignore_stderr

    These default to false, and will black-hole these streams wherever we
    have control to do so.

    Controlled by the MG_IGNORE_{STDOUT,STDERR} environment variables.

lib/App/Multigit.pm  view on Meta::CPAN


Scripts may also therefore change C<%BEHAVIOUR> themselves, but it is probably
badly behaved to do so.

=head3 report_on_no_output

Defaults to true; this should be used by scripts to determine whether to bother
mentioning repositories that gave no output at all for the given task. If you
use C<App::Multigit::Repo::report>, this will be honoured by default.

Controlled by the C<MG_REPORT_ON_NO_OUTPUT> environment variable.

=head3 ignore_stdout

=head3 ignore_stderr

These default to false, and will black-hole these streams wherever we have
control to do so.

Controlled by the C<MG_IGNORE_{STDOUT,STDERR}> environment variables.

lib/App/Multigit.pm  view on Meta::CPAN


=head3 skip_readonly

Do nothing to repositories that have C<readonly = 1> set in C<.mgconfig>.

Controlled by the C<MG_SKIP_READONLY> environment variable.

=cut

our %BEHAVIOUR = (
    report_on_no_output => $ENV{MG_REPORT_ON_NO_OUTPUT} // 1,
    ignore_stdout       => !!$ENV{MG_IGNORE_STDOUT},
    ignore_stderr       => !!$ENV{MG_IGNORE_STDERR},
    concurrent          => $ENV{MG_CONCURRENT_PROCESSES} // 20,
    skip_readonly       => !!$ENV{MG_SKIP_READONLY},
    output_only         => !!$ENV{MG_OUTPUT_ONLY},
);

=head2 @SELECTED_REPOS

If this is not empty, it should contain paths to repositories. Relative paths
will be determined relative to L<C<<mg_root>>|/mg_root>.

Instead of using the C<.mgconfig>, the directories in here will be used as the
list of repositories on which to work.

script/mg  view on Meta::CPAN

        help => \&usage,
        'quiet|q' => sub {
            # Can't use + for this because -v needs to counteract it.
            $qs++;
        },
        'verbose|v' => sub {
            $qs--;
        },
        'concurrent|c=i' => \$ENV{MG_CONCURRENT_PROCESSES},
        'skip-readonly' => \$ENV{MG_SKIP_READONLY},
        'output-only|o' => \$ENV{MG_OUTPUT_ONLY},
    );

    if ($qs > 0) {
        $ENV{MG_REPORT_ON_NO_OUTPUT} = 0;
    }
    if ($qs > 1) {
        $ENV{MG_IGNORE_STDERR} = 1;
    }
}

my $cmd = shift or usage 1;

if ($cmd eq 'help') {
    # mg help is just usage



( run in 0.470 second using v1.01-cache-2.11-cpan-c6e0e5ac2a7 )