[hackers] [sbase] ls: improve default format || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Mon, 21 Jul 2014 17:44:19 +0200

commit 35959cd1c41272d6342b3befc054d9f505552e66
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Mon Jul 21 13:42:33 2014 +0000

    ls: improve default format
    
    truncate username and group for better alignment for now. in the future
    better tabular printing will be implemented.

diff --git a/ls.c b/ls.c
index a4621d6..ca8f178 100644
--- a/ls.c
+++ b/ls.c
_AT_@ -282,7 +282,7 @@ output(Entry *ent)
                 fmt = "%b %d %H:%M";
 
         strftime(buf, sizeof buf, fmt, localtime(&ent->mtime));
- printf("%s %2ld %-4s %-5s %6lu %s %s%s", mode, (long)ent->nlink, pwname,
+ printf("%s %4ld %-8.8s %-8.8s %10lu %s %s%s", mode, (long)ent->nlink, pwname,
                grname, (unsigned long)ent->size, buf, ent->name, indicator(ent->mode));
         if(S_ISLNK(ent->mode)) {
                 if((len = readlink(ent->name, buf, sizeof buf)) == -1)
Received on Mon Jul 21 2014 - 17:44:19 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 17:48:22 CEST