Parsing ~/.cabal/config fails when the 'verbose' setting is uncommented #980

Closed
23Skidoo opened this Issue Jul 27, 2012 · 1 comment

Projects

None yet

3 participants

@23Skidoo
Member

Steps to reproduce (with a fresh ~/.cabal/config):

  1. Uncomment the line verbose: 1 in ~/.cabal/config
  2. Run cabal update

This results in the following error:

cabal: Command.optionToFieldDescr: feature not implemented

This happens because optionVerbosity in D.S.Setup produces an OptArg option, but optionToFieldDescr in D.S.Command doesn't handle such options:

OptArg _ _ _ _readE _ _ -> -- The behaviour in this case is not clear, and it has no use so far,
                           -- so we avoid future surprises by not implementing it.
                           error "Command.optionToFieldDescr: feature not implemented"

What is the correct way to fix this? Change optionVerbosity to a ReqArg option or make viewAsFieldDescr a total function?

@kosmikus
Collaborator
kosmikus commented Aug 7, 2012

I was aware of this, and actually thought there's an open bug about this issue, but now I can't find it ...

@tibbe tibbe pushed a commit that closed this issue Aug 11, 2012
@23Skidoo 23Skidoo Make 'viewAsFieldDescr' a total function.
Fixes #980 by allowing to create config fields from options with optional
arguments. Without this change, setting the 'jobs' or 'verbose' fields in the
config file results in a fatal error on startup.
bb38831
@tibbe tibbe closed this in bb38831 Aug 11, 2012
@tibbe tibbe added a commit that referenced this issue Aug 16, 2012
@23Skidoo 23Skidoo Make 'viewAsFieldDescr' a total function.
Fixes #980 by allowing to create config fields from options with optional
arguments. Without this change, setting the 'jobs' or 'verbose' fields in the
config file results in a fatal error on startup.
d50b2d3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment