From: Sven Schöling Date: Mon, 24 Jun 2013 09:27:42 +0000 (+0200) Subject: nocolor ooption für rose_auto_create_model X-Git-Tag: release-3.1.0beta1~310 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=1765abe6d9790634e1fbaa9dd70b633315b21bb3;p=kivitendo-erp.git nocolor ooption für rose_auto_create_model --- diff --git a/scripts/rose_auto_create_model.pl b/scripts/rose_auto_create_model.pl index d2b688684..b5cdfba7d 100755 --- a/scripts/rose_auto_create_model.pl +++ b/scripts/rose_auto_create_model.pl @@ -184,12 +184,14 @@ sub parse_args { help => sub { pod2usage(verbose => 99, sections => 'NAME|SYNOPSIS|OPTIONS') }, quiet => \ my $quiet, diff => \ my $diff, + 'color!' => \ my $color, ); $options->{client} = $client; $options->{all} = $all; $options->{nocommit} = $nocommit; $options->{quiet} = $quiet; + $options->{color} = defined $color ? $color : 1; if ($diff) { if (eval { require Text::Diff; 1 }) { @@ -210,7 +212,11 @@ sub show_diff { Text::Diff::diff($text_a, $text_b, { OUTPUT => sub { for (split /\n/, $_[0]) { - print colored($_, $colors{substr($_, 0, 1)}), $/; + if ($config{color}) { + print colored($_, $colors{substr($_, 0, 1)}), $/; + } else { + print $_, $/; + } } }}); }