Closed mattjbray closed 8 months ago
Note that the output format is different to the real opam list, which tabulates the output and includes the package synopsis by default.
Could you fix this so that the output matches, at least w.r.t the tabulation? Some packages could conceivably be using opam list
in a script, having it output something unexpected could lead to some difficult-to-debug errors.
Ok, I've changed it to tabulate output. To separate the package name from the version it naively splits on the final occurrence of -
, but this will break if the version contains a -
character.
With that caveat, the output is now equivalent to opam list --short --columns=name,version --color=never
.
Scripts that call fake opam list
with different arguments will get unexpected output.
If that's a concern we could log a warning if the arguments are different to the above? I'd rather not require those arguments because the intention here is to provide a useful output to a human typing opam list
.
If that's a concern we could log a warning if the arguments are different to the above? I'd rather not require those arguments because the intention here is to provide a useful output to a human typing opam list.
Could we maybe name the command something else then? E.g. opam nix-list
, and make opam list
throw a relevant error?
I ended up doing this myself and merging this into main. You can now do opam fake-list
and get the package list. Thanks a lot for the contribution!
Sometimes it's useful to see what opam packages and versions have been picked by the solver.
This adds a simple implementation for
opam list
which just reads$OCAMLPATH
.Note that the output format is different to the real
opam list
, which tabulates the output and includes the package synopsis by default.