Skip to content

Conversation

@raphael-proust
Copy link
Contributor

Please update master_changes.md file with your changes.

@raphael-proust
Copy link
Contributor Author

couldn't run the tests locally (i think it requires some kind of set up) but I did run the compiled binary with the new flag and it worked

Copy link
Member

@kit-ty-kate kit-ty-kate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution. Would you have time to add some tests? (format is documented in https://github.com/ocaml/opam/blob/master/tests/reftests/readme.md) If not we'll do it whenever we have some time

@raphael-proust
Copy link
Contributor Author

I had forgotten to push the test file, doing so now

@kit-ty-kate
Copy link
Member

Looking at this change once again i'm realizing that it is already possible print the exact same thing using the raw field syntax:

opam list --columns=name,license:

This isn't ideal and has been discussed in the past (#3664). We could at least document it in the man section for --columns but this should also be improved at some point imo (although i'm not sure what's the best way to do that in a backward-compatible manner, if you have ideas feel free to drop them here)

@raphael-proust
Copy link
Contributor Author

I didn't know about the raw-field syntax. It should be documented in the man/help I think. I can add that.

Also the inconsistency between columns and field in show/list is surprising. But that's for another PR I guess.

@raphael-proust
Copy link
Contributor Author

Added a specific mention in the doc. I realised it was mentioned before but this one is more visible.

Copy link
Member

@kit-ty-kate kit-ty-kate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modulo the PR title that needs to be changed, lgtm

mk_opt ~cli cli_original ["columns"] "COLUMNS" ~section
(Printf.sprintf "Select the columns to display among: %s.\n\
The special form $(b,<field>:) (field name followed by \
colon, e.g., $(b,license:)) selects an arbitraty field. \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
colon, e.g., $(b,license:)) selects an arbitraty field. \
colon, e.g., $(b,license:)) selects an arbitrary field. \

@kit-ty-kate
Copy link
Member

ah my bad i looked only at the new changes, the rest of the PR should probably require a longer discussion. The master_changes.md entries should also be updated (doc + test). I can do the last rebase at the end if needed

@rjbou rjbou self-requested a review January 14, 2026 16:03
@rjbou
Copy link
Collaborator

rjbou commented Jan 14, 2026

It worth also adding a full test for opam list, but that's for another PR too.

@avsm
Copy link
Member

avsm commented Jan 27, 2026

Nice! Just for the record, this is what moby/vpnkit (from Docker) uses to autogenerate the licenses we ship with Docker; https://github.com/moby/vpnkit/blob/master/dune#L12 -- the raw field syntax is fine, but we can upgrade to this once released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants