From: Alex Riesen Date: Thu, 5 Jul 2007 22:06:56 +0000 (+0200) Subject: Add -v|--verbose to git remote to show remote url X-Git-Tag: v1.5.3-rc1~72 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=09ff69bb39b386e24a39723d9e20263a915bc6d6;p=git.git Add -v|--verbose to git remote to show remote url Many other commands already have such an option, and I find it practical to see where all the remotes actually come from. Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- diff --git a/git-remote.perl b/git-remote.perl index b59cafdf8..01cf48022 100755 --- a/git-remote.perl +++ b/git-remote.perl @@ -319,9 +319,21 @@ sub add_usage { exit(1); } +local $VERBOSE = 0; +@ARGV = grep { + if ($_ eq '-v' or $_ eq '--verbose') { + $VERBOSE=1; + 0 + } else { + 1 + } +} @ARGV; + if (!@ARGV) { for (sort keys %$remote) { - print "$_\n"; + print "$_"; + print "\t$remote->{$_}->{URL}" if $VERBOSE; + print "\n"; } } elsif ($ARGV[0] eq 'show') {