Am Sonntag 21 Februar 2010 19:58:12 schrieb Artyom Kazak: > 2010/2/21 Daniel Fischer <daniel.is.fisc...@web.de>: > > Am Sonntag 21 Februar 2010 18:20:43 schrieb Artyom Kazak: > >> > Enclose it in double quotes (perhaps single quotes would also work) > >> > >> No, I want my program to work the same way as UNIX "echo" does. > >> Without any double quotes. > > > > Okay, what about > > > > "If you absolutely positively want all the rest of the options in a > > command line to go to the program (and not the RTS), use a ––RTS." > > > > $ ./prog +RTS --RTS +RTS > > > > ? (BTW, enclosing in quotes doesn't work anyway if the argument > > consists *only* of "+RTS", same as with echo, echo "-e" doesn't output > > '-e' either). > > So, if I type "./prog +RTS --RTS +RTS", the output will be "+RTS". But > I want the output to be equal to the input IN ALL CASES, without any > quotes, additional options, etc. I want all the command line to go to > my program. How can I do it? (The only way I know now - hacking the > GHC. If there are no other ways, I'll do it.)
Shell wrapper: $ cat wopTest ./opTest +RTS --RTS $@ $ cat opTest.hs module Main (main) where import System.Environment (getArgs) main = mapM_ print =<< getArgs $ ./wopTest +RTS -sstderr -RTS "+RTS" "-sstderr" "-RTS" Other than that, hacking GHC is the only way I can think of either, since looking for RTS-options is a fixed (and generally necessary) part of the RTS. But why do you want that behaviour so much that you'd be willing to hack GHC? _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe