[GHC] #7843: GHC should be able to list all possible command line options

#7843: GHC should be able to list all possible command line options -----------------------------+---------------------------------------------- Reporter: jstolarek | Owner: Type: feature request | Status: new Priority: normal | Component: Driver Version: 7.6.2 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- I would be happy to have automatic completion of command-line options in GHC. For that we need GHC to be able to list all its possible command line options, similarly to cabal's `--list-options` option. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7843 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7843: GHC should be able to list all possible command line options -----------------------------+---------------------------------------------- Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: new Priority: normal | Component: Driver Version: 7.6.2 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Changes (by jstolarek): * owner: => jstolarek -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7843#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7843: GHC should be able to list all possible command line options -----------------------------+---------------------------------------------- Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: patch Priority: normal | Component: Driver Version: 7.6.2 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Changes (by jstolarek): * status: new => patch -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7843#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7843: GHC should be able to list all possible command line options -----------------------------+---------------------------------------------- Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: patch Priority: normal | Component: Driver Version: 7.6.2 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by jstolarek): The patch adds --show-options option that displays all available options longer than two characters. Now it will be possible to use bash auto completion feature with GHC. Please ignore the second patch - I forgot to mark the checkbox to overwrite the existing file when uploading the new version of my patch. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7843#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7843: GHC should be able to list all possible command line options -----------------------------+---------------------------------------------- Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: infoneeded Priority: normal | Component: Driver Version: 7.6.2 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Changes (by ezyang): * status: patch => infoneeded Comment: Hey Jan, sorry about the delay. It looks like the patch no longer applies to head; could you rebase it (and also squash the commits in the process?) -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7843#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7843: GHC should be able to list all possible command line options -----------------------------+---------------------------------------------- Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: infoneeded Priority: normal | Component: Driver Version: 7.6.2 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by jstolarek): Here's the new patch - I rebased it onto current master and squashed commits into one. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7843#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7843: GHC should be able to list all possible command line options -----------------------------+---------------------------------------------- Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: patch Priority: normal | Component: Driver Version: 7.6.2 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Changes (by jstolarek): * status: infoneeded => patch -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7843#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7843: GHC should be able to list all possible command line options -----------------------------+---------------------------------------------- Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: patch Priority: normal | Component: Driver Version: 7.6.2 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by jstolarek): Bumping this up - before the patch gets out of sync again ;-) -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7843#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7843: GHC should be able to list all possible command line options ---------------------------------+------------------------------------------ Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: patch Priority: normal | Milestone: Component: Driver | Version: 7.6.2 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Changes (by igloo): * difficulty: => Unknown Comment: Why do you filter out length 1 and 2 options? -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7843#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7843: GHC should be able to list all possible command line options ---------------------------------+------------------------------------------ Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: patch Priority: normal | Milestone: Component: Driver | Version: 7.6.2 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Comment(by ezyang): Validating. igloo: I can guess that it is because the point is for autocompletion, in which case it doesn't do you any good to autocomplete a length one option, since you have to already know what it is! -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7843#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7843: GHC should be able to list all possible command line options ---------------------------------+------------------------------------------ Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: patch Priority: normal | Milestone: Component: Driver | Version: 7.6.2 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Comment(by igloo): Well, you may not be sure that the flag exists, and be looking at the list of completions. Also, there's nothing about the command "ghc --show-options" that suggests that it is only for use by autocompletion. I would expect it would show all options. So if the shorter options don't cause any problems, I'd suggest not including the filter. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7843#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7843: GHC should be able to list all possible command line options ---------------------------------+------------------------------------------ Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: patch Priority: normal | Milestone: Component: Driver | Version: 7.6.2 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Comment(by jstolarek): Except for what Edward pointed out, another reason why I decided to filter out short flags is that almost all of them require additional parameter (e.g. -H1G), which cannot be auto-completed. If you think that `filter` is unnecessary than of course it can be removed. I'm also not sure if removing `filter` will not cause any glitches - I think that some of the short options might have been duplicated on the list, but I'm not sure of that. I can provide new patch tomorrow - at the moment I'm getting some unexpected compilation errors. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7843#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7843: GHC should be able to list all possible command line options
---------------------------------+------------------------------------------
Reporter: jstolarek | Owner: jstolarek
Type: feature request | Status: patch
Priority: normal | Milestone:
Component: Driver | Version: 7.6.2
Keywords: | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: None/Unknown
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------+------------------------------------------
Comment(by jan.stolarek@…):
commit a28731b3a14ff6ef9c7dca8327d073e6ebb6b773
{{{
Author: Jan Stolarek

#7843: GHC should be able to list all possible command line options ---------------------------------+------------------------------------------ Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: patch Priority: normal | Milestone: Component: Driver | Version: 7.6.2 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Comment(by simonpj): Thanks. Is the flag documented in the user manual? Simon -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7843#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7843: GHC should be able to list all possible command line options ---------------------------------+------------------------------------------ Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: patch Priority: normal | Milestone: Component: Driver | Version: 7.6.2 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Comment(by jstolarek): Whops, I didn't think about that. I'm attaching two patches. First of them updates user documentation. After playing a bit with autocompletion I think that the decision to exclude short options was wrong. Consider this example of autocmpletion without filtering out short options: {{{ [killy@xerxes : ~] ghc -c -c -caf-all -cpp }}} If the `filter` is used then the user will be hinted with only two last flags, which indeed might lead her to believe that there is no `-c` flag. Therefore I think that `filter` should be removed - my second patch updates the user documentation and removes the filter. Also, without the `filter` the `-O` option is listed twice. I believe this is because `-O` can be used by itself and also with a parameter (e.g. `-O2`). Possible solutions are: - use `nub` - use some hack to remove this single option - ignore it, because shell will not list duplicates anyway: {{{ [killy@xerxes : ~] ghc -O -O -Odph -Onot }}} Since `nub` is O(n^2^) and I don't like hacks I chose the third option. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7843#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7843: GHC should be able to list all possible command line options ---------------------------------+------------------------------------------ Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: patch Priority: normal | Milestone: Component: Driver | Version: 7.6.2 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Comment(by jstolarek): Bump. I think it would be good to apply the second patch before it gets out of sync with HEAD. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7843#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7843: GHC should be able to list all possible command line options
---------------------------------+------------------------------------------
Reporter: jstolarek | Owner: jstolarek
Type: feature request | Status: patch
Priority: normal | Milestone:
Component: Driver | Version: 7.6.2
Keywords: | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: None/Unknown
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------+------------------------------------------
Comment(by jan.stolarek@…):
commit 2280f9651ea4f08d8d7c29affbb134d6769e42e0
{{{
Author: Jan Stolarek

#7843: GHC should be able to list all possible command line options -------------------------------+-------------------------------------------- Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: closed Priority: normal | Milestone: Component: Driver | Version: 7.6.2 Resolution: fixed | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: -------------------------------+-------------------------------------------- Changes (by igloo): * status: patch => closed * resolution: => fixed Comment: Applied, thanks! -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7843#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (2)
-
GHC
-
GHC