Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you get Cabal to print all available versions of a package?

Tags:

haskell

cabal

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)
like image 345
Jindřich Mynarz Avatar asked Nov 20 '17 20:11

Jindřich Mynarz


1 Answers

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.

like image 178
hvr Avatar answered Sep 28 '22 02:09

hvr