[/!\ Traffic] Further `ls` command output improvement #782

Closed
kyrylo opened this Issue Dec 16, 2012 · 3 comments

Comments

Projects
None yet
2 participants
Owner

kyrylo commented Dec 16, 2012

Table output for ls is nice, but it's still a pain to find something in a big table. Since table is alphabetically sorted, we can benefit from this quite easily. First of all, we need to change the order of output.

What we currently have.

> ls
#...
Foo.methods:
abcd     abc    ab     a
bcde     bcd    bc     b
cdef     cde    cd     c
#...

What it should look like.

> ls
#...
Foo.methods:
abcd  bc
abc   b
ab    cdef
a     cde
bcde  cd
bcd   c
#...

I think the second output is already better without reservation. But even with this approach we can improve it further!

Secondly, since instance methods are tintless, we can do this:

> ls
#...
Foo.methods:
*a*bcd  bc
abc     b
ab      *c*def
a       cde
*b*cde  cd
bcd     c
#...

It's a bit hard to spot the difference (and moreover the benefit), but believe me, it's a huge improvement. The idea is to highlight every new first letter. You can see something similar in phone books.

abcd abc ab a bcde bcd bc b cdef cde cd c

Methods that start with underscores or other non-letters should not highlight their first character (_, ==, %), because it's already easy to spot them.

Important note
This will work only for instance and class methods. Other enities are already coloured. That's not a big deal, because we can always change this (I have a few ideas).

Contributor

rking commented Dec 16, 2012

Kyrylo,

Interesting idea re: colorized first letters, though it will probably look of for a class that has few methods (and I'd be hard-pressed to think of a class following the Single Responsibility Principle needing extra formatting help like this).

As for the alphabetizing downward, check out the feature/ls-colors branch.

Owner

kyrylo commented Jan 14, 2013

In the end it turned out it's a bad idea. Big up to everyone who contributed their screenshots (by the by, they are clickable)! @jraregris, @ConradIrwin, @banister, @locks, @robgleeson, @rf-, @YorickPeterse and me.

The first version:

The second version:

@kyrylo kyrylo closed this Jan 14, 2013

Owner

kyrylo commented Jan 14, 2013

The patch used for this change: https://gist.github.com/4527481

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment