Skip to content

Commit

Permalink
--show-options lists all flags. Add user documentation for #7843
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Stolarek authored and Ian Lynagh committed Jun 13, 2013
1 parent a532f40 commit 2280f96
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/users_guide/flags.xml
Expand Up @@ -59,6 +59,12 @@
<entry>mode</entry>
<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>
Expand Down
12 changes: 12 additions & 0 deletions docs/users_guide/using.xml
Expand Up @@ -470,6 +470,18 @@ module X where
</listitem>
</varlistentry>

<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>
Expand Down
2 changes: 1 addition & 1 deletion ghc/Main.hs
Expand Up @@ -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) ++
Expand Down

0 comments on commit 2280f96

Please sign in to comment.