Move status printing into a function and rename existing end function
pkg-search: Add missing -Q version support

Reported by:	eadler