-
Notifications
You must be signed in to change notification settings - Fork 691
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
[RFC] Add 'cabal new-path' command #4220
Conversation
Seems like a good idea to me. /cc @dcoutts |
Related: #3643. |
Not sure why the build is failing for
|
It's because you didn't add the new module to the Cabal file. |
More substantive comment: this somewhat overlaps with information you can get from plan.json, right? Would it make sense to move all of this to plan.json and document more heavily what keys are available, or maybe there is a place for a way to interrogate for a specific value without having to parse the output subsequently? |
Oh, whoops. I would very much like to not have to go though a json parser to get this stuff out of cabal. One of the main motivations for me sit down and implement this is to be able to use it from shell scripts and such. As I said this is just a prototype to discuss if this is a thing we want to add. I would certainly add more options to extract specific fields rather than just dump them all if we decide to do that. |
Yes, that's what I was alluding to at the end of my comment. If you're specifically interested in grabbing these values for shell script, you probably don't want a pile of colon separated paths; that's less convenient for command line use? (But maybe you also want to avoid repeatedly calling cabal new-path to keep things snappy?) In any case, designing a CLI interface like this involves a large degree of taste. My feedback is:
|
I played with this a bit: https://github.com/phadej/cabal/tree/danielg-new-path I hope I'll have time today to clean up the impl, but the idea that
would output only single line which can be used in shell scripts. I.e.
Side-comment: the command line parsing lib is quite not-for-human-beings :S |
I think this fell too far behind, probably easier to start from scratch. |
Since a lot of 'new-*' commands are still missing I keep having to fiddle around with hard-coded paths in projects where I use new-build, so I though why can't Cabal have a command that tells you all those tedious internal paths (like Stack).
This is really just a quick prototype to get feedback, so what do you guys think?