Closed oshyshko closed 6 years ago
Have you tried adding {-# OPTIONS_GHC -fno-cse #-}
to the top of the module? Does that fix it?
I've just tried it. It doesn't seem to make any change to --help
output.
I tried adding {-# OPTIONS_GHC -fno-cse #-}
at 3 places:
./cmdargs.hs
(before DeriveDataTypeable pragma)./src/Main.hs
(same thing as ./cmdargs.hs
, but compiled) + did stack clean && stack build && stack exec tape -- --help
./tape.cabal
, in ghc-options
section as -fno-cse
Just in case, my environment is:
$ stack list-dependencies | grep cmdargs
cmdargs 0.10.18
$ stack ghc -- --version
The Glorious Glasgow Haskell Compilation System, version 8.0.2
OK, I see the problem. You have basically done CSE by hand :). The second problem is a consequence of the first - if they were all the same they'd become a common flag. To make them common again you can define:
let fileSpec x = x &= typFile &= help "Use file instead of stdin/stdout"
_ <- cmdArgs $ modes
[ Record { file = fileSpec def
, command = def &= typ "COMMAND" &= argPos 0
, commandArgs = def &= typ "ARGS" &= args }
, Replay { file = fileSpec def
, delays = def &= help "Reproduce delays in stdout/stderr (off by default)"}
, Inspect { file = fileSpec def}
]
&= help "Records and replays stdout/stder produced by a command"
return ()
By making the annotations under a lambda they apply correctly in all the places. Not ideal, but it should work robustly.
Nice. The lambda + {-# OPTIONS_GHC -fno-cse #-}
did the trick.
Thank you.
I am trying to get a help page that looks like:
I made it to this point:
...that results in:
I am trying to find a workaround to these problems:
What would be your recommendations in fixing these two things?
P.S. Thank you for your beautifully designed library.