diff options
author | panne <unknown> | 2000-06-25 17:21:52 +0000 |
---|---|---|
committer | panne <unknown> | 2000-06-25 17:21:52 +0000 |
commit | 86d6ddb1b13aed8147af8ae2e9e3f01707b90b38 (patch) | |
tree | 57b451b54835f3a3948f3028811e958fc2c23779 /ghc/driver | |
parent | c4a1f165c299464746f1836176d02b5febaf56b3 (diff) | |
download | haskell-86d6ddb1b13aed8147af8ae2e9e3f01707b90b38.tar.gz |
[project @ 2000-06-25 17:21:52 by panne]
* -#include's arg needs not be separate anymore.
* Nuke leading and trailing spaces around option arguments.
Diffstat (limited to 'ghc/driver')
-rw-r--r-- | ghc/driver/Main.hs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ghc/driver/Main.hs b/ghc/driver/Main.hs index 4535f299eb..f27c26abf6 100644 --- a/ghc/driver/Main.hs +++ b/ghc/driver/Main.hs @@ -1656,7 +1656,7 @@ opts = ------- Miscellaneous ----------------------------------------------- , ( "cpp" , NoArg (writeIORef cpp_flag True) ) - , ( "#include" , SepArg (add cmdline_hc_includes) ) + , ( "#include" , HasArg (add cmdline_hc_includes) ) , ( "no-link-chk" , NoArg (return ()) ) -- ignored for backwards compat ------- Output Redirection ------------------------------------------ @@ -1835,9 +1835,9 @@ processOneArg (('-':arg):args) = do findArg :: String -> (String,OptKind) findArg arg - = case [ (rest,k) | (pat,k) <- opts, - Just rest <- [my_prefix_match pat arg], - is_prefix k || null rest ] of + = case [ (remove_spaces rest, k) | (pat,k) <- opts, + Just rest <- [my_prefix_match pat arg], + is_prefix k || null rest ] of [] -> throwDyn (UnknownFlag ('-':arg)) (one:_) -> one @@ -1971,3 +1971,6 @@ newsuf suf s = remove_suffix s '.' ++ suf newdir :: String -> String -> String newdir dir s = dir ++ '/':drop_longest_prefix s '/' + +remove_spaces :: String -> String +remove_spaces = reverse . dropWhile isSpace . reverse . dropWhile isSpace |