FS#76682 - [pacman] pacman -qV should display version data in a single line
Attached to Project:
Pacman
Opened by drws (drws) - Sunday, 27 November 2022, 15:53 GMT
Last edited by Toolybird (Toolybird) - Thursday, 01 December 2022, 02:12 GMT
Opened by drws (drws) - Sunday, 27 November 2022, 15:53 GMT
Last edited by Toolybird (Toolybird) - Thursday, 01 December 2022, 02:12 GMT
|
Details
Description: 'pacman -qV' currently prints same output as
'pacman -V'. The quiet option could and should apply to
version query as well. An expected output of 'pacman -qV'
would be:
Pacman v6.0.2 - libalpm v13.0.2 |
This task depends upon
What Pacman outputs is great, except for not taking its own quiet option into account when it evidently could (and should for KISS purposes).
--quiet is documented to only effect some operations. I am after a reason why it is needed here and pkg-config is not enough.
$ pkg-config --modversion libalpm
13.0.2
Probably numerous ways to extract the pacman version but here's 1 quick example:
$ pacman -V | awk '/alpm/ {print $3}' | sed 's/^v//'
6.0.2
Probably not worth implementing in pacman itself but I'll let @Allan decide :)
Counting-in the KISS principle it seems natural that --quiet suppressed the additional ASCII art and information around the information that was actually requested from Pacman - a version (string).
Trying be more specific about the use case, I need it for exactly what it is, to print a quick single-lined Pacman AND ALPM version report sometimes during system administration. pkg-config doesn't give you that easily so the two solutions aren't duplicates.