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

Open
23Skidoo opened this Issue Mar 25, 2013 · 3 comments

Projects

None yet

3 participants

@23Skidoo
Member

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 Apr 23, 2015
@ttuegel ttuegel added this to the _|_ milestone Apr 23, 2015
@BardurArantsson
Collaborator

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? :))

@23Skidoo
Member

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.

@BardurArantsson
Collaborator

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