-pgm option syntax
Jens Petersen
juhp at 01.246.ne.jp
Wed Feb 20 08:29:11 EST 2002
Jens Petersen <petersen at redhat.com> writes:
> Jens Petersen <juhp at 01.246.ne.jp> writes:
>
> > It would be good if ghc would at like give a better error
> > message when an empty cmd is passed to -pgmX.
>
> Rather I think it should abort rather than forking an empty
> command...
How about something like the following untested patch to
this effect? (In the ideal world it would test that c is a
valid program flag, but anyway...)
Jens
2002-02-20 Jens Petersen <juhp at 01.246.ne.jp>
* compiler/main/SysTools.lhs (setPgm): Abort when a null cmd is
passed to a -pgmX option.
Index: SysTools.lhs
===================================================================
RCS file: /cvs/fptools/ghc/compiler/main/SysTools.lhs,v
retrieving revision 1.70
diff -u -r1.70 SysTools.lhs
--- SysTools.lhs 2002/02/16 19:39:51 1.70
+++ SysTools.lhs 2002/02/20 13:15:44
@@ -417,6 +417,7 @@
-- The string is the flag, minus the '-pgm' prefix
-- So the first character says which program to override
+setPgm ([c]) = throwDyn (UsageError ("-pgm" ++ [c]": no CMD argument"))
setPgm ('P' : pgm) = writeIORef v_Pgm_P pgm
setPgm ('F' : pgm) = writeIORef v_Pgm_F pgm
setPgm ('c' : pgm) = writeIORef v_Pgm_c pgm
More information about the Glasgow-haskell-bugs
mailing list