# Cabal-add: extend Cabal build-depends from the command line

**URL:** <https://discourse.haskell.org/t/cabal-add-extend-cabal-build-depends-from-the-command-line/7911>\
**Category:** Show and Tell\
**Created:** [October 20, 2023, 8:26pm UTC](https://discourse.haskell.org/t/cabal-add-extend-cabal-build-depends-from-the-command-line/7911 "2023-10-20T20:26:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![bradrn](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/bradrn/32/264_2.png) [@bradrn](https://discourse.haskell.org/u/bradrn)\
**Post date:** [October 21, 2023, 12:22am UTC](https://discourse.haskell.org/t/cabal-add-extend-cabal-build-depends-from-the-command-line/7911/2 "2023-10-21T00:22:46Z")

</div>

[As promised](http://discourse.haskell.org/t/convenience-in-the-haskell-ecosystem/7731/170), I had a go at breaking this, since I got some time today. I managed to very nearly do it with a `common` stanza… but it appears that Cabal is fine with having two `build-depends` clauses in a target, so that doesn’t actually break anything. Very impressive work! (It even detects whether I’ve used leading or trailing commas, which is really nice.)

That being said, I dislike the restriction that it can only add packages at the beginning of the `build-depends`. Personally, I strongly prefer a style where the first line is reserved for `base`, and this tool messes it up. It would be nicer to, for instance, insert the new package in alphabetical order, or something similar.

---

_[View the full topic](https://discourse.haskell.org/t/cabal-add-extend-cabal-build-depends-from-the-command-line/7911)._
