Eliminate duplicate flags in the tab completion of ghci's :set command.
authorJudah Jacobson <judah.jacobson@gmail.com>
Thu, 16 Oct 2008 01:57:21 +0000 (01:57 +0000)
committerJudah Jacobson <judah.jacobson@gmail.com>
Thu, 16 Oct 2008 01:57:21 +0000 (01:57 +0000)
compiler/ghci/InteractiveUI.hs

index 3b5fde9..a2108bb 100644 (file)
@@ -1739,7 +1739,8 @@ completeHomeModule w = do
 
 completeSetOptions w = do
   return (filter (w `isPrefixOf`) options)
-    where options = "args":"prog":allFlags
+    where options = "args":"prog":flagList
+          flagList = map head $ group $ sort allFlags
 
 completeFilename w = do
     ws <- Readline.filenameCompletionFunction w