From 1765abe6d9790634e1fbaa9dd70b633315b21bb3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 24 Jun 2013 11:27:42 +0200 Subject: [PATCH] =?utf8?q?nocolor=20ooption=20f=C3=BCr=20rose=5Fauto=5Fcre?= =?utf8?q?ate=5Fmodel?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- scripts/rose_auto_create_model.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 $_, $/; + } } }}); } -- 2.20.1