Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Add support for subcommands to `Distribution.Simple.Command` #1257

23Skidoo opened this Issue · 3 comments

3 participants


It'd be nice if the D.S.Command framework supported subcommands directly. Currently we have to resort to parsing command-line arguments manually to implement things like cabal sandbox add-source --snapshot.

Related: #1104.

@ttuegel ttuegel added the library label
@ttuegel ttuegel added this to the _|_ milestone

I'm not sure I understand this.

Given that cabal-install is a monolithic program, I would suggest just parsing everything (including environment variables) into a giant record which could be a Monoid and then successively mappend-ing as cabal-install goes along reading from config-on-disk, command-line options, etc... and then passing successively smaller bits to commands as we go. Am I massively deluded that such a refactoring could be possible? (... or would solve this issue? :))


Look at how commands are specified declaratively in e.g. D.C.Setup module. This is about making it possible to implement subcommands in the same way.


Yeah, the way the flag handling is currently implemented is completely insane and absurd. Btw, it has nothing to do with "implementing subcommands in the same way". The current system is bizarre and weird and leads to convolution by design. (I have no evidence in this message, but I'll hopefully submit a proof of concept for how to fix this in a few days -- for a completely unrelated issue, btw -- but I still think this issue is completely beyond any plausible probability of an actual implementation).

My opinion is that this issue is not "actionable" and thus should not be an issue. Hence: Close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.