How do you get Cabal to print all available versions of a package? Running cabal -v info package-name prints something like this; in case many versions are available:
Versions available: (0.1.5.5), (0.1.5.6), (0.1.6.3), (0.1.6.4), 0.1.6.5,
0.2.4.2, 0.2.5.0, 0.2.6.0, 0.2.7.0 (and 26 others)
An indirect way to accomplish this, e.g. for the text package is
cabal list --simple-output text | awk '$1=="text" { print $2 }'
The post-processing via awk is needed because cabal list currently only supports substring matching, but not exact matching.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With