Skip to content
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

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

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

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

23Skidoo opened this issue Mar 25, 2013 · 3 comments
Labels
Cabal: other old-milestone: ⊥ Moved from https://github.com/haskell/cabal/milestone/5 type: enhancement
Milestone

Comments

@23Skidoo
Copy link
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.

@BardurArantsson
Copy link
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
Copy link
Member Author

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
Copy link
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
Labels
Cabal: other old-milestone: ⊥ Moved from https://github.com/haskell/cabal/milestone/5 type: enhancement
Projects
None yet
Development

No branches or pull requests

4 participants