Hi,

> No! Homebrew's search "functionality" is my biggest problem with it. The
> columns you mentioned make it hard to read because it makes it harder to
> see how they are sorted. The alphabetization seems to be in order by column
> at first, but then at some random row the alphabetical order will switch
> over to the next column over, instead of continuing down that same column,
> with no marker to show where it happened, so you really have to be paying
> attention to find where something is in a screen of search output from
> Homebrew.

Nobody said we'd have to write a weird implementation.

> Also I find it useful that MacPorts prints the port descriptions
> when doing `port search`

And I'm all for keeping that if there are less than, say 10 search results. 
When there are more than 10 results, we could print the names only along with 
instructions on how to get full results, should a user really want to read 
through all the descriptions (how often do you open the second page on Google 
again?). I also think the output could be improved to waste less space and use 
color. For more than 10 results, I think
  port -q search git | while read a; read b; read c; do printf "%-28s %-28s 
%-28s\n" "$a" "$b" "$c"; done | grep -iE --color '^|git'
is a pretty good shot at what I'd like to see (optimized to 80 columns terminal 
and this specific query). For less than 10 results, the following looks nice to 
my eyes:

$> port search git
port        version          description
----        -------          -----------
babl-devel  0.1.11-20140305  Babl is a library for dynamically handling pixel
                             formats and managing conversions between them.
                             This is the development version based on a recent
                             snapshot of upstream <red>git</red> master.
bitcoin     0.8.6            client user interface for a peer-to-peer
                             di<red>git</red>al currency (yes, we also print
                             useless matches like these)
etc.

This might help, but given the amount of information we display (name, version, 
categories, description) it might not work very well either. I'd rather remove 
some of the information by default and improve the search results by matching 
for names first (and if no port names match, print a message and automatically 
search descriptions). If you don't think that's a good idea take a look at the 
results of `port search git'.

> Besides
> it is already possible to trim down the output of `port search`: you can
> just use the `-q` flag.

I never said we should remove this way to print the results. I was just 
suggesting to switch the default to be more useful to the casual user (i.e. the 
one who doesn't know about port -q search).

-- 
Clemens Lang
_______________________________________________
macports-users mailing list
macports-users@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-users

Reply via email to