diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2017-02-22 19:59:55 -0800 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2017-02-23 13:46:08 -0800 |
commit | 0a77cedb914a67b8bd7c4af1f87714dc497fec3e (patch) | |
tree | 8ed6ed0fa2b1d2b1a01156a0141ece1c44577504 /ghc | |
parent | de805583db457e2ee64468f3ed4cd9092d4ef8c8 (diff) | |
download | haskell-0a77cedb914a67b8bd7c4af1f87714dc497fec3e.tar.gz |
Have --backpack complain if multiple files are passed.
Summary:
At the moment it silently swallows the actual arguments; not good!
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: rwbarton, bgamari, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D3173
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/Main.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ghc/Main.hs b/ghc/Main.hs index 0984bf7935..29012f6f60 100644 --- a/ghc/Main.hs +++ b/ghc/Main.hs @@ -162,7 +162,7 @@ main' postLoadMode dflags0 args flagWarnings = do DoInteractive -> (CompManager, HscInterpreted, LinkInMemory) DoEval _ -> (CompManager, HscInterpreted, LinkInMemory) DoMake -> (CompManager, dflt_target, LinkBinary) - DoBackpack _ -> (CompManager, dflt_target, LinkBinary) + DoBackpack -> (CompManager, dflt_target, LinkBinary) DoMkDependHS -> (MkDepend, dflt_target, LinkBinary) DoAbiHash -> (OneShot, dflt_target, LinkBinary) _ -> (OneShot, dflt_target, LinkBinary) @@ -253,7 +253,7 @@ main' postLoadMode dflags0 args flagWarnings = do DoAbiHash -> abiHash (map fst srcs) ShowPackages -> liftIO $ showPackages dflags6 DoFrontend f -> doFrontend f srcs - DoBackpack b -> doBackpack b + DoBackpack -> doBackpack (map fst srcs) liftIO $ dumpFinalStats dflags6 @@ -455,7 +455,7 @@ data PostLoadMode | StopBefore Phase -- ghc -E | -C | -S -- StopBefore StopLn is the default | DoMake -- ghc --make - | DoBackpack String -- ghc --backpack foo.bkp + | DoBackpack -- ghc --backpack foo.bkp | DoInteractive -- ghc --interactive | DoEval [String] -- ghc -e foo -e bar => DoEval ["bar", "foo"] | DoAbiHash -- ghc --abi-hash @@ -482,8 +482,8 @@ doEvalMode str = mkPostLoadMode (DoEval [str]) doFrontendMode :: String -> Mode doFrontendMode str = mkPostLoadMode (DoFrontend (mkModuleName str)) -doBackpackMode :: String -> Mode -doBackpackMode str = mkPostLoadMode (DoBackpack str) +doBackpackMode :: Mode +doBackpackMode = mkPostLoadMode DoBackpack mkPostLoadMode :: PostLoadMode -> Mode mkPostLoadMode = Right . Right @@ -614,7 +614,7 @@ mode_flags = , defFlag "C" (PassFlag (setMode (stopBeforeMode HCc))) , defFlag "S" (PassFlag (setMode (stopBeforeMode (As False)))) , defFlag "-make" (PassFlag (setMode doMakeMode)) - , defFlag "-backpack" (SepArg (\s -> setMode (doBackpackMode s) "-backpack")) + , defFlag "-backpack" (PassFlag (setMode doBackpackMode)) , defFlag "-interactive" (PassFlag (setMode doInteractiveMode)) , defFlag "-abi-hash" (PassFlag (setMode doAbiHashMode)) , defFlag "e" (SepArg (\s -> setMode (doEvalMode s) "-e")) |