@matheusbsbs / matheus-bagliano / commits / 09ff69bb39
Fork 0

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 <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Alex Riesen committed Jul 6, 2007 at 00:06 UTC 09ff69bb39b386e24a39723d9e20263a915bc6d6
1 file changed +13 -1
git-remote.perl
+13 -1
@@ -319,9 +319,21 @@ sub add_usage {
319 exit(1);
320 }
321
322 +local $VERBOSE = 0;
323 +@ARGV = grep {
324 + if ($_ eq '-v' or $_ eq '--verbose') {
325 + $VERBOSE=1;
326 + 0
327 + } else {
328 + 1
329 + }
330 +} @ARGV;
331 +
332 if (!@ARGV) {
333 for (sort keys %$remote) {
324 - print "$_\n";
334 + print "$_";
335 + print "\t$remote->{$_}->{URL}" if $VERBOSE;
336 + print "\n";
337 }
338 }
339 elsif ($ARGV[0] eq 'show') {