--show-options lists all flags. Add user documentation for #7843
authorJan Stolarek <jan.stolarek@p.lodz.pl>
Fri, 7 Jun 2013 07:15:32 +0000 (09:15 +0200)
committerIan Lynagh <ian@well-typed.com>
Thu, 13 Jun 2013 19:49:37 +0000 (20:49 +0100)
docs/users_guide/flags.xml
docs/users_guide/using.xml
ghc/Main.hs

index 5366360..e034cd7 100644 (file)
             <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>
index 9c6fbf7..1453e73 100644 (file)
@@ -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>
index 52a90d0..5af51bb 100644 (file)
@@ -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) ++