From 09ff69bb39b386e24a39723d9e20263a915bc6d6 Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Fri, 6 Jul 2007 00:06:56 +0200 Subject: [PATCH] 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 --- git-remote.perl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/git-remote.perl b/git-remote.perl index b59cafdf87..01cf480221 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') { -- 2.11.4.GIT