Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

No printer for url.src #5637

Open
dbuenzli opened this issue Aug 21, 2023 · 5 comments
Open

No printer for url.src #5637

dbuenzli opened this issue Aug 21, 2023 · 5 comments

Comments

@dbuenzli
Copy link
Contributor

Hello!

I found the following interaction disappointing:

> opam --version
2.1.5
> opam info uunf.15.0.0 -f url.src,url.checksum 

[ERROR] No printer for "url.src"

Is there an other way to query these fields ?

(xref)

@kit-ty-kate
Copy link
Member

kit-ty-kate commented Aug 21, 2023

The syntax for -f is quite confusing. I'm not entirely sure what's the requirements for this syntax but in some cases you have to add a colon at the end of each field paths:

opam info uunf.15.0.0 -f url.src:,url.checksum:

I've always treated it as just a weird command and moved on but reading the manpage entry it looks like it might be a bug and omitting the colon should be an accepted syntax. I'll tag it as a bug for now.

@dbuenzli
Copy link
Contributor Author

Well at least the manpage should mention something that works in all cases. I don't mind adding a colon but if the manpage tells me I don't have to, I'm not going to :-)

@rjbou
Copy link
Collaborator

rjbou commented Aug 22, 2023

The field: syntax is a shortcut for raw fields. The shortcut section.field is available only on raw display, that's why url.src has no printer, it is not understood as a field.
The manpage should at least be updated with those information.

@kit-ty-kate
Copy link
Member

What's a raw field and why do we not allow section.field in non-raw mode?

@rjbou
Copy link
Collaborator

rjbou commented Aug 22, 2023

Raw field is printed by reading directly the opam file (opamfile.file_contents), while field is taken from an already processed opam file (OpamFile.OPAM.t). Why do we not allow non raw field with section field, it's the current implem, it can be added.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants