[GHC] #9259: GHCi should list its available command line options

#9259: GHCi should list its available command line options -------------------------------------------+------------------------------- Reporter: jstolarek | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Driver | Version: Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Easy (less than 1 hour) | Type of failure: Blocked By: | None/Unknown Related Tickets: | Test Case: | Blocking: -------------------------------------------+------------------------------- GHC can now list its command line options with `--show-options` (#7843). GHCi should be able to do the same. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9259 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9259: GHCi should list its available command line options -------------------------------+------------------------------------------- Reporter: jstolarek | Owner: Type: feature | Status: new request | Milestone: Priority: normal | Version: Component: Driver | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 hour) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | -------------------------------+------------------------------------------- Comment (by jstolarek): Oh, and once this is done we should update [[GhcFile(driver/ghci- usage.txt)]] to inform user about this possibility (see [[GhcFile(driver /ghc-usage.txt)]] for an example). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9259#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9259: GHCi should list its available command line options -------------------------------------+------------------------------------ Reporter: jstolarek | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Driver | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by jstolarek): * difficulty: Easy (less than 1 hour) => Unknown Comment: After a quick look at the source code I'm not sure if this is that simple. `--show-options` triggers pre-startup mode, which terminates the compiler before it even starts. But `ghci` is an alias for `ghc --interactive`, so we'd have to recognize a special case of `--interactive` and `--show- options` being used at the same time. That's probably possible, but it requires more work than I'm willing to put into this at the moment. Leaving this as a newcomer-friendly task. The relevant code is in [[GhcFile(ghc/Main.hs)]]. It is also important to distinguish which options are supported with GHCi and which are not. I'm not sure if this information is stored in one place somewhere in the compiler, but we need to have access to it. When this is fixed the user documentation needs to be updated as well. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9259#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9259: GHCi should list its available command line options -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: Type: feature | Status: new request | Milestone: Priority: normal | Version: Component: Driver | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by kolmodin): Making `--interactive` and `--show-options` work together is simple, just a few more lines to `setMode`. The time consuming part with this task is to cleanly separate which flags work in GHC and which work in GHCi. The flags are defined in a few different places; * `ModeFlags` defined in `ghc/Main.hs` which apply to both GHC and GHCi. * `StaticFlags` defined in `compiler/main/StaticFlags.hs` which applies to both GHC and GHCi. * DynFlags defined in `compiler/main/DynFlags.hs`. There are a few different kinds of flags here (dynflags, package flags, fflags, fwarn, ...), each of which where some are for GHC and some for GHCi. For some flags there is code guarding to make sure you don't mix them, like together with `--interactive` you cannot use `-prof`, `-threaded`, `-unreg`, `-debug` or `-ticky`. For other flags there is no such code, and it's not always obvious where each flag has effect. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9259#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9259: GHCi should list its available command line options -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: kolmodin Type: feature | Status: new request | Milestone: Priority: normal | Version: Component: Driver | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by kolmodin): * owner: => kolmodin -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9259#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9259: GHCi should list its available command line options -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: kolmodin Type: feature | Status: new request | Milestone: Priority: normal | Version: Component: Driver | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D337 | -------------------------------------+------------------------------------- Changes (by kolmodin): * differential: => Phab:D337 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9259#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9259: GHCi should list its available command line options -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: kolmodin Type: feature | Status: new request | Milestone: Priority: normal | Version: Component: Driver | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D337 | -------------------------------------+------------------------------------- Comment (by afleck): Oops, sorry. I didn't realize there was already a patch on Phabricator. I'm new to this... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9259#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9259: GHCi should list its available command line options -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: kolmodin Type: feature | Status: new request | Milestone: Priority: normal | Version: Component: Driver | Keywords: newcomer Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D337 | -------------------------------------+------------------------------------- Changes (by jstolarek): * keywords: => newcomer -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9259#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9259: GHCi should list its available command line options -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: kolmodin Type: feature | Status: new request | Milestone: Priority: normal | Version: Component: Driver | Keywords: newcomer Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D337 | -------------------------------------+------------------------------------- Comment (by thomie): I am currently running into `panic`s using `ghc-7.9.20141113 --interactive --show-options`, see #9799. I guess these will go away once Phab:D337 is landed. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9259#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9259: GHCi should list its available command line options
-------------------------------------+-------------------------------------
Reporter: jstolarek | Owner: kolmodin
Type: feature | Status: new
request | Milestone:
Priority: normal | Version:
Component: Driver | Keywords: newcomer
Resolution: | Architecture: Unknown/Multiple
Operating System: | Difficulty: Unknown
Unknown/Multiple | Blocked By:
Type of failure: | Related Tickets:
None/Unknown |
Test Case: |
Blocking: |
Differential Revisions: Phab:D337 |
-------------------------------------+-------------------------------------
Comment (by Austin Seipp

#9259: GHCi should list its available command line options -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: kolmodin Type: feature | Status: new request | Milestone: Priority: normal | Version: Component: Driver | Keywords: newcomer Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D337 | -------------------------------------+------------------------------------- Comment (by kolmodin): With the patch 624a7c5a2eee0c0ba486a45550680052c2c79849 mentioned above, the bulk of the work is done. What remains is to; - Clean up DynFlags, a lot of the lines are over 80 chars - Let more people look at the partitioning of the flags into ghc/ghci/all, correcting any mistakes where a flag has been assigned to the wrong mode - Some flags are defined in DynFlags but not documented in the User's Guide. Should they be marked as hidden? Mail ghc-devs and find out. - Possibly update documentation about ghc's new ability to use --interactive and --show-options together. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9259#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9259: GHCi should list its available command line options
-------------------------------------+-------------------------------------
Reporter: jstolarek | Owner: kolmodin
Type: feature | Status: new
request | Milestone:
Priority: normal | Version:
Component: Driver | Keywords: newcomer
Resolution: | Architecture: Unknown/Multiple
Operating System: | Difficulty: Unknown
Unknown/Multiple | Blocked By:
Type of failure: | Related Tickets:
None/Unknown |
Test Case: |
Blocking: |
Differential Revisions: Phab:D337 |
-------------------------------------+-------------------------------------
Comment (by Austin Seipp

#9259: GHCi should list its available command line options -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: kolmodin Type: feature request | Status: closed Priority: normal | Milestone: 7.12.1 Component: Driver | Version: Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D337 -------------------------------------+------------------------------------- Changes (by thomie): * status: new => closed * resolution: => fixed * milestone: => 7.12.1 Comment: I think all work is done here. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9259#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9259: GHCi should list its available command line options -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: kolmodin Type: feature request | Status: closed Priority: normal | Milestone: 7.12.1 Component: Driver | Version: Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D337 -------------------------------------+------------------------------------- Comment (by jstolarek): Replying to [comment:12 thomie]:
I think all work is done here.
Well, I think we still didn't solve this: * Some flags are defined in DynFlags but not documented in the User's Guide. Should they be marked as hidden? Mail ghc-devs and find out. I don't think we git any replies about these flags and without that we cannot do better. Not sure if we should keep this ticket open as a reminder? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9259#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC