diff options
-rwxr-xr-x | badcommit-fixup | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/badcommit-fixup b/badcommit-fixup index b8cb88a..ca2e0df 100755 --- a/badcommit-fixup +++ b/badcommit-fixup @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # usage: -# .../badcommit-fixup --test +# .../badcommit-fixup [-- --test # .../badcommit-fixup --real use strict; @@ -10,10 +10,19 @@ use POSIX; use IPC::Open2; use Data::Dumper; -die unless "@ARGV" eq "--test" or "@ARGV" eq "--real"; +my $real; -my ($modeopt) = @ARGV; -my $real = ($modeopt eq '--real'); +foreach my $a (@ARGV) { + if ($a eq '--test') { + $real = 0; + } elsif ($a eq '--real') { + $real = 1; + } else { + die "$a ?"; + } +} + +die unless defined $real; my $gcfpid = open2 \*GCFO, \*GCFI, 'git cat-file --batch' or die $!; |