-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make output less vebose in --quiet
mode
#2001
Conversation
This is really not the right approach, the sections also print the packages. With your patch it doesn't print anything at all when used with This also didn't work in old dnf. Can I ask why do you want to hide the headers? |
@kontura I needed to get a list of updates and their versions and these headers were in the way https://gitlab.com/abitrolly/dnf-go-gui/-/blob/master/docs/DNF-API.md Proper machine readable export, like CSV or JSON will remote the need.
That's unfortunate. I also don't see that patching core lib to handle different verbosity levels is the right thing. |
Right, actually we have two libraries:
The list command is not intended to be parsed.
Note that old dnf4 used to add the new line at the end automatically so you might have to check that if you want to use it also with dnf4. I should also mention that in some situations the output of Edit: I see you already know this, I should have read your document fully before. |
@kontura I think I fixed the quiet flag for now. If |
I am sorry I should have been more clear yesterday but I don't like these changes. While it is true that dnf5 lacks the machine readable output for most commands in this situation you should use the We don't want to encourage users to parse the Perhaps I can keep this open for a while to see if other developers have a different opinion but personally I would close it. |
I agree with kontura: Text user interface is not a machine interface. Imposing that onus on the human output would make difficult to evolve it. Also human interface lacks many guarantees API has: Delimiting records, escaping, data types, data structures, versioning, locale independence etc. In short, it's unreasonable to handle a user interface as a machine interface. Both from DNF users and from DNF developers. Ideally this should be handled by D-Bus interface. |
Well, maybe the feature is excessive, but does it work at least? Can other people use the PR as an example how to control output verbosity? Realistically |
Yes, it works. I don't think there are any technical issue with your approach. In my opinion for your use case it would be best to use the API directly via GO bindings. |
Makes
--quiet
option description more quiet.Suppress header in
dnf list --upgrades
and similar one table command.Closes #753.