pkg info -q -a gives a list of all installed packages, without descriptions (correct) pkg info bash gives full info for whichever version of bash is installed pkg info -q bash shows nothing it should show full version of installed package, as in the -1 -a output
pkg info -q can used like pkg info -q > packagelist.txt.
I am reopening this because: pkg help info shows: pkg info [-AbBDdefIklOpqRrs] [-Cgix] pkg-name That means one should be able to give: pkg info -q bash or pkg info -q bash-4.4.23_1 Neither of which works. While one can clearly do pkg info -q | grep bash to get the desired result, either the pkg command is not working as documented and needs fixing, or the documentation needs to be fixed to reflect how the command actually works.
It works in combination with other switches: pkg info -qo firefox www/firefox pkg info -qR firefox displays the full Manifest pkg info -qf firefox the normal pkg info firefox output
> It works in combination with other switches: > > pkg info -qo firefox > www/firefox In that case, it *should* work by itself, as documented. It seems rather bizarre behavior in terms of code to have it work in combination with other flags with a filename argument, but not alone; yet work alone with no filename argument. It looks to me like the query_flags will be empty with only -q present, as it is taken out with the "quiet" flag, and pkgdb_it_next probably does not return EPKG_OK (about line 448 in info.c).
the logic is inheritted from the historical behaviour of pkg_info and can be revisited. the logic as I understood when I had to implement it is: pkg info <somthing> query if that thing exists, so it shows some output if yes (and I mimic pkg_info output) and nothing not with the return error code 0 or 1. so if you add '-q' then you end up with no output at all and the same error code -o request an explicit information, so it always prints it, same for -f -a do request everything to be printed. again I can revisit this logic this is very simple code to change.
Created attachment 256905 [details] manpage discussed on IRC. - changing pkg-info behaviour is likely to break no matter which way its changed - improve documentation to clarify why pkg-info(8) sometimes prints output, or not
Comment on attachment 256905 [details] manpage ^Triage: to patch submitter: Bugzilla cannot recognize this as a patch. Can you resubmit without the formatting, please?
^Triage: feedback timeout (> 6 months).