summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/users_guide/flags.xml6
-rw-r--r--docs/users_guide/using.xml12
-rw-r--r--ghc/Main.hs2
3 files changed, 19 insertions, 1 deletions
diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml
index 5366360f37..e034cd7311 100644
--- a/docs/users_guide/flags.xml
+++ b/docs/users_guide/flags.xml
@@ -60,6 +60,12 @@
<entry>-</entry>
</row>
<row>
+ <entry><option>&ndash;&ndash;show-options</option></entry>
+ <entry>display the supported command line options</entry>
+ <entry>mode</entry>
+ <entry>-</entry>
+ </row>
+ <row>
<entry><option>&ndash;&ndash;info</option></entry>
<entry>display information about the compiler</entry>
<entry>mode</entry>
diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml
index 9c6fbf714a..1453e73087 100644
--- a/docs/users_guide/using.xml
+++ b/docs/users_guide/using.xml
@@ -473,6 +473,18 @@ module X where
<varlistentry>
<term>
<cmdsynopsis>
+ <command>ghc --show-options</command>
+ </cmdsynopsis>
+ <indexterm><primary><option>&ndash;&ndash;show-options</option></primary></indexterm>
+ </term>
+ <listitem>
+ <para>Print the supported command line options. This flag can be used for autocompletion in a shell.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>
+ <cmdsynopsis>
<command>ghc --info</command>
</cmdsynopsis>
<indexterm><primary><option>&ndash;&ndash;info</option></primary></indexterm>
diff --git a/ghc/Main.hs b/ghc/Main.hs
index 52a90d07e7..5af51bba46 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) ++