From 8d001c13d0fcd5fee76dcf97814e1b36a053791d Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Tue, 13 May 2008 14:51:12 -0700 Subject: [PATCH] [commit-patch] Add --verbose option. --- commit-patch | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/commit-patch b/commit-patch index 3974d9f..18ff603 100755 --- a/commit-patch +++ b/commit-patch @@ -6,15 +6,29 @@ use strict; use Cwd qw(abs_path); -use IPC::Run qw(run); +use IPC::Run; use File::Temp qw(tempfile); use Getopt::Long; use Pod::Usage; +my ($verbose); +sub run { + if ($verbose) { + for (@_) { + print join ' ', @$_ if ref $_ eq 'ARRAY'; + print " $_ " if ref $_ eq ''; + print '[',ref $_,'] ' if ref $_ ne 'ARRAY' && ref $_ ne ''; + } + print "\n"; + } + IPC::Run::run(@_); +} + my ($message, $message_filename); GetOptions("message|m=s" => \$message, "F|message-file=s" => \$message_filename, "h|help" => sub { pod2usage(1) }, + "v|verbose" => \$verbose, ) and scalar @ARGV == 1 or pod2usage(2); my $patch = shift; @@ -114,7 +128,7 @@ commit-patch - commit patches to I, I or I repositories =head1 SYNOPSIS -commit-patch [B<-m> I] [B<-F> I] I +commit-patch [B<-m> I] [B<-F> I] [B<-v>] I =head1 DESCRIPTION @@ -143,6 +157,9 @@ B<-F>, B<--message-file>=I - You can optionally get the commit message from a file. This is generally only useful for scripting B. +B<-v>, B<--verbose> - Turn on debugging. This will print the commands +that B is running to get the patch committed. + =head1 DIAGNOSTICS B works by manipulating the working directory using -- 2.51.2