X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Futils%2Fhscpp%2Fhscpp.prl;h=03a839876dcb2f00395db183dd312d0a1130d570;hb=5b8f8425fe043fbbf32c8768a709ca20e98b115b;hp=fb1bf46c360f0ab386057b8efd220e14d61a2ddc;hpb=72779ca1925f3ec98182fd82b31bd2ba67b905e0;p=ghc-hetmet.git diff --git a/ghc/utils/hscpp/hscpp.prl b/ghc/utils/hscpp/hscpp.prl index fb1bf46..03a8398 100644 --- a/ghc/utils/hscpp/hscpp.prl +++ b/ghc/utils/hscpp/hscpp.prl @@ -15,21 +15,16 @@ $file = ''; $Cpp = ${RAWCPP}; -foreach (@ARGV) { - /^-v$/ && do { $Verbose = 1; next; }; - - /^[^-]/ && do { - if ($file ne '') { - die "usage: hscpp [arg...] file"; - } else { - $file = $_; - }; - next; - }; - +while (@ARGV) { + $_ = $ARGV[0]; + /^-v$/ && do { $Verbose = 1; shift(@ARGV); next; }; + /^[^-]/ && $#ARGV == 0 && do { $file = $_; shift(@ARGV); next; }; push @args, $_; + shift(@ARGV); } +die "usage: hscpp [arg...] file" if ($file eq ''); + print STDERR "hscpp:CPP invoked: $Cpp @args - <$file\n" if $Verbose; open(INPIPE, "$Cpp @args - <$file |") || die "Can't open C pre-processor pipe\n";