[commit: ghc] master: --show-options lists all flags. Add user documentation for #7843 (2280f96)

Ian Lynagh igloo at earth.li
Thu Jun 13 22:15:35 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

https://github.com/ghc/ghc/commit/2280f9651ea4f08d8d7c29affbb134d6769e42e0

>---------------------------------------------------------------

commit 2280f9651ea4f08d8d7c29affbb134d6769e42e0
Author: Jan Stolarek <jan.stolarek at p.lodz.pl>
Date:   Fri Jun 7 09:15:32 2013 +0200

    --show-options lists all flags. Add user documentation for #7843

>---------------------------------------------------------------

 docs/users_guide/flags.xml |  6 ++++++
 docs/users_guide/using.xml | 12 ++++++++++++
 ghc/Main.hs                |  2 +-
 3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml
index 5366360..e034cd7 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 9c6fbf7..1453e73 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 52a90d0..5af51bb 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) ++





More information about the ghc-commits mailing list