supercrabtree / k

k is the new l, yo
1.78k stars 123 forks source link

OSX: "'numfmt' command not found, human readable output will not work" #48

Closed dgmstuart closed 9 years ago

dgmstuart commented 9 years ago

As mentioned in #21, numfmt is not available in OSX, so when running k -h I get:

'numfmt' command not found, human readable output will not work.
    Falling back to normal file size output

BUT numfmt is included in coreutils which I think I got from Homebrew originally (brew install coreutils?). The caveat is that it is named gnumfmt.

Would it be possible for k to look for gnumfmt if numfmt is not available? Or is it just down to me somehow telling my machine where to find it?

I tried alias numfmt='gnumfmt', but that didn't work - I'm guessing because k doesn't have access to that alias?

CC @chrstphrknwtn @sattellite

chrstphrknwtn commented 9 years ago

@dgmstuart, turns out it was easy to fix / implement human readable file size for OS X knowing that it's gnumfmt with gnu coreutils (I had no idea).

In c08c3d3b8afcd1d5bd95deb5debd624bcc65ac5b I've added a check for numfmt or gnumfmt, so k -h should work as expected on OS X now.

dgmstuart commented 9 years ago

Great :) Thanks for your response