From f6e7618153610805af91c0b4a3f43d18737f52fc Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Mon, 7 Oct 2013 17:10:39 +0200 Subject: Allow the showconf command to query specific options --- mgagit | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/mgagit b/mgagit index a9387ae..63aa5ce 100755 --- a/mgagit +++ b/mgagit @@ -38,9 +38,12 @@ END run => \&showconf, descr => 'Show YAML mgagit configuration', usage => < 2; + if (@_ == 1) { + $res = YAML::Dump($r{repos}{$_[0]}); + } elsif (@_ == 2) { + $res = MGA::Git::repo_config(\%r, @_); + $res .= "\n" if defined $res; + } else { + my $c = $MGA::Git::config; + $c->{r} = \%r; + $res = YAML::Dump($c); + } + print defined $res ? $res : "undef\n"; + exit !defined $res; } if (@ARGV == 0 || !$actions{$ARGV[0]}) { -- cgit v1.2.1