
Hi everybody! TL;DL GHC 7.10 will have better bash completion, try it out! I'd like your help to verify the categorisation of DynFlags into ghc / ghci / shared or hidden flags. I've been working on improving the command line completion support in GHC 7.10. The main idea is that it should be more convenient to use GHC from the command line, without knowing all the flags by heart. You should be able to partly type a flag and then hit TAB twice to display the possible completions. For example; $ ghc -f<TAB><TAB> If you'd like to try it out, here's what you need to do; $ cd ghc-head $ source completion/ghc.bash Et voilà! Your bash shell will now have these super powers! There's a README https://github.com/ghc/ghc/blob/master/completion/README with details for a permanent setup. End users should ultimately not have to do anything to get this working. Linux distributions, and packages for other OSs are responsible for copying the required file to the right location. GHC had some basic support for command line completion even before my work, but now it also includes two significant changes compared to GHC 7.8; - "ghc" and "ghci" has different completions. - GHC 7.10 will ship and maintain the necessary bash components (and the scripts you contribute for other shells!). To support different completions for ghc and ghci, the DynFlags have been annotated with which mode the flags works. How this works has been documented under "Note [Supporting CLI completion]". Essentially all flags have been divided into four groups; - Flags only useful for ghc - Flags only useful for ghci - Flags useful from both ghc and ghci - Flags that should be invisible I've made this categorisation best I could, but it'd be nice to have another few pair of eyes glance through the flags. The separation of flags is well contained within the DynFlags module, please have a look! https://github.com/ghc/ghc/blob/master/compiler/main/DynFlags.hs The work was implemented in D337 https://phabricator.haskell.org/D337, D532 https://phabricator.haskell.org/D532 and D536 https://phabricator.haskell.org/D536 and is tracked in trac #9259 https://ghc.haskell.org/trac/ghc/ticket/9259. Regards, Lennart

Hi, I guess you CCed me because of: Am Mittwoch, den 10.12.2014, 16:43 +0400 schrieb Lennart Kolmodin:
Linux distributions, and packages for other OSs are responsible for copying the required file to the right location.
I’ll include that file once we get around to packaging 7.10 (which isn’t too soon :-)) Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org

2014-12-10 16:16 GMT+03:00 Joachim Breitner
Hi,
I guess you CCed me because of:
Am Mittwoch, den 10.12.2014, 16:43 +0400 schrieb Lennart Kolmodin:
Linux distributions, and packages for other OSs are responsible for copying the required file to the right location.
Yes, and also Sergei and Jens :) I’ll include that file once we get around to packaging 7.10 (which isn’t
too soon :-))
That's great, thanks! Regards, Lennart
Greetings, Joachim
-- Joachim “nomeata” Breitner mail@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org

On Wed, 10 Dec 2014 16:43:57 +0400
Lennart Kolmodin
Hi everybody!
TL;DL GHC 7.10 will have better bash completion, try it out! I'd like your help to verify the categorisation of DynFlags into ghc / ghci / shared or hidden flags.
Thank you! On the way to users :) https://github.com/gentoo-haskell/gentoo-haskell/commit/d6f63341693063e60168... sf / # ghc --print-li<TAB><ENTER> /usr/lib64/ghc-7.10.0.20141222 sf / # ghci --print-li<TAB><ENTER> ghc: panic! (the 'impossible' happened) (GHC version 7.10.0.20141222 for x86_64-unknown-linux): ghc: panic! (the 'impossible' happened) (GHC version 7.10.0.20141222 for x86_64-unknown-linux): v_unsafeGlobalDynFlags: not initialised Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug Absolutely not your fault, just makes such things more discoverable :] Thanks again! -- Sergei

Reported this as #9963. Janek Dnia sobota, 3 stycznia 2015, Sergei Trofimovich napisał:
On Wed, 10 Dec 2014 16:43:57 +0400
Lennart Kolmodin
wrote: Hi everybody!
TL;DL GHC 7.10 will have better bash completion, try it out! I'd like your help to verify the categorisation of DynFlags into ghc / ghci / shared or hidden flags.
Thank you! On the way to users :) https://github.com/gentoo-haskell/gentoo-haskell/commit/d6f63341693063e6016 8bbddffb0806621696689
sf / # ghc --print-li<TAB><ENTER> /usr/lib64/ghc-7.10.0.20141222
sf / # ghci --print-li<TAB><ENTER> ghc: panic! (the 'impossible' happened) (GHC version 7.10.0.20141222 for x86_64-unknown-linux): ghc: panic! (the 'impossible' happened) (GHC version 7.10.0.20141222 for x86_64-unknown-linux): v_unsafeGlobalDynFlags: not initialised Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Absolutely not your fault, just makes such things more discoverable :] Thanks again!
participants (4)
-
Jan Stolarek
-
Joachim Breitner
-
Lennart Kolmodin
-
Sergei Trofimovich