diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml
index 5366360f37c7..e034cd731192 100644
--- a/docs/users_guide/flags.xml
+++ b/docs/users_guide/flags.xml
@@ -59,6 +59,12 @@
mode
-
+
+
+ display the supported command line options
+ mode
+ -
+
display information about the compiler
diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml
index 9c6fbf714ad5..1453e7308755 100644
--- a/docs/users_guide/using.xml
+++ b/docs/users_guide/using.xml
@@ -470,6 +470,18 @@ module X where
+
+
+
+ ghc --show-options
+
+
+
+
+ Print the supported command line options. This flag can be used for autocompletion in a shell.
+
+
+
diff --git a/ghc/Main.hs b/ghc/Main.hs
index 52a90d07e731..5af51bba46c3 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -700,7 +700,7 @@ showVersion = putStrLn (cProjectName ++ ", version " ++ cProjectVersion)
showOptions :: IO ()
showOptions = putStr (unlines availableOptions)
where
- availableOptions = map ((:) '-') . filter ((>2) . length) $
+ availableOptions = map ((:) '-') $
getFlagNames mode_flags ++
getFlagNames flagsDynamic ++
(filterUnwantedStatic . getFlagNames $ flagsStatic) ++