summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorNikita Kartashov <snailandmail@gmail.com>2016-02-11 11:58:30 +0100
committerBen Gamari <ben@smart-cactus.org>2016-02-11 16:01:38 +0100
commit46af6835ac68d104ee56c29afdfa523c165db2fb (patch)
tree92c691bfda3e5555e3d7254ebc42ebbef5bcc408 /ghc
parent51a33924fc118d9b6c1db556c75c0d010ef95e18 (diff)
downloadhaskell-46af6835ac68d104ee56c29afdfa523c165db2fb.tar.gz
compiler: Do not suggest nor complete deprecated flags fix trac issue #11454
Previously, all flags were present in user suggest and completion. This commit removes the deprecated ones from there. It is done by saving deprecation info at the moment of flag definition. Reviewers: rwbarton, austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D1883
Diffstat (limited to 'ghc')
-rw-r--r--ghc/GHCi/UI.hs4
-rw-r--r--ghc/Main.hs2
2 files changed, 3 insertions, 3 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index 2528503092..deb37556ce 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -2861,11 +2861,11 @@ listHomeModules w = do
completeSetOptions = wrapCompleter flagWordBreakChars $ \w -> do
return (filter (w `isPrefixOf`) opts)
where opts = "args":"prog":"prompt":"prompt2":"editor":"stop":flagList
- flagList = map head $ group $ sort allFlags
+ flagList = map head $ group $ sort allNonDeprecatedFlags
completeSeti = wrapCompleter flagWordBreakChars $ \w -> do
return (filter (w `isPrefixOf`) flagList)
- where flagList = map head $ group $ sort allFlags
+ where flagList = map head $ group $ sort allNonDeprecatedFlags
completeShowOptions = wrapCompleter flagWordBreakChars $ \w -> do
return (filter (w `isPrefixOf`) opts)
diff --git a/ghc/Main.hs b/ghc/Main.hs
index 73552d3038..5605438f63 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -909,7 +909,7 @@ unknownFlagsErr fs = throwGhcException $ UsageError $ concatMap oneError fs
where
oneError f =
"unrecognised flag: " ++ f ++ "\n" ++
- (case fuzzyMatch f (nub allFlags) of
+ (case fuzzyMatch f (nub allNonDeprecatedFlags) of
[] -> ""
suggs -> "did you mean one of:\n" ++ unlines (map (" " ++) suggs))