New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--cabal-verbose should allow setting verbosity level #1369

Open
mwu-tow opened this Issue Nov 18, 2015 · 3 comments

Comments

Projects
None yet
4 participants
@mwu-tow
Contributor

mwu-tow commented Nov 18, 2015

From what I observed, using --cabal-verbose passes --verbose to Setup program. However, the resulting output is not as detailed is it could be. The --verbose flag takes an 0..3 int parameter.
Passing --verbose without value is equivalent to ``--verbose=2. I'd like to be able to obtain cabal output from--verbose=3`.

The seemingly natural solution would be to add the same value parameter to --cabal-verbose and pass it to Setup.

@borsboom

This comment has been minimized.

Show comment
Hide comment
@borsboom

borsboom Nov 22, 2015

Contributor

Perhaps, like with Stack's --verbose/--verbosity, we should add a --cabal-verbosity option. I think I'd rather it take Stack's standard verbosity values and converts them to cabal-install's numeric ones (perhaps, in addition, accepting cabal-install's numeric values). A pull request would be welcome.

Contributor

borsboom commented Nov 22, 2015

Perhaps, like with Stack's --verbose/--verbosity, we should add a --cabal-verbosity option. I think I'd rather it take Stack's standard verbosity values and converts them to cabal-install's numeric ones (perhaps, in addition, accepting cabal-install's numeric values). A pull request would be welcome.

@lucamolteni

This comment has been minimized.

Show comment
Hide comment
@lucamolteni

lucamolteni Mar 26, 2016

Mmhhh.. It seems like we've broken the old behaviour, sorry.

We're working on a fix :)

lucamolteni commented Mar 26, 2016

Mmhhh.. It seems like we've broken the old behaviour, sorry.

We're working on a fix :)

@nadirs

This comment has been minimized.

Show comment
Hide comment
@nadirs

nadirs Mar 26, 2016

The thing is, we should probably implement a unified --cabal-verbose[=N]. That is, you can supply a value or if you don't it should use a default value. So, there are 3 cases:

  1. no option at all (so it uses a default value, e.g. 1)
  2. option is used but with no value (so it uses another default value, e.g. 2)
  3. option is used with an explicit value (e.g. --cabal-verbose=3)

The library optparse-applicative doesn't seem to expose a combinator for this case, so the solution would be to compose two parsers for case 2 and 3 using Alternative (<|>), both wrapped by an optional combinator.

nadirs commented Mar 26, 2016

The thing is, we should probably implement a unified --cabal-verbose[=N]. That is, you can supply a value or if you don't it should use a default value. So, there are 3 cases:

  1. no option at all (so it uses a default value, e.g. 1)
  2. option is used but with no value (so it uses another default value, e.g. 2)
  3. option is used with an explicit value (e.g. --cabal-verbose=3)

The library optparse-applicative doesn't seem to expose a combinator for this case, so the solution would be to compose two parsers for case 2 and 3 using Alternative (<|>), both wrapped by an optional combinator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment