Commit Graph

19 Commits

Author SHA1 Message Date
Ben S
e5e426fc60 Right-align file sizes
Currently there's only one numeric column, and that's the file size, so it gets
special treatment.

I was originally going to have a folder file size field be filled up with '-'s
as far as it could go, leaving it entirely up to the column how its field gets
formatted. But then I saw just one '-' working just fine, so I left it like
that. In the first try, columns could do anything they want when padding a
string (including changing the padding character or just changing it entirely),
but now there's no point.
2014-06-04 13:45:14 +01:00
Ben S
2d41333117 Upgrade to latest Rust nightly
- s/to_owned/to_string/g
- TotalEq/TotalOrd changes
- snake_case of identifiers
2014-06-02 21:02:06 +01:00
Ben S
5abd53742e Remove extraneous lifetimes 2014-06-01 16:30:18 +01:00
Ben S
4722c8991b Implement natural sorting on filenames 2014-06-01 11:54:31 +01:00
Ben S
6edf2c0d4d Highlight the current user 2014-05-27 19:05:15 +01:00
Ben S
48d8a46df8 Code cleanup (commenting the why) 2014-05-27 12:37:51 +01:00
Ben S
1dbe20c8c5 Move sorting and reversing into options object 2014-05-26 11:50:46 +01:00
Ben S
05b2d541ac s/StrBuf/String/g 2014-05-26 11:08:33 +01:00
Ben S
b116889abc Change format of file sizes to be shorter
I'm copying ls here because we don't really need the 'B' for bytes to be
listed every time. I think it looks better the new way. Unlike ls, don't
list directory sizes, because I've never found the pseudo-sizes they get
given at all useful.

Also, fix a bug where aligning columns didn't work when the number of
format characters (like '\x1B' and '[') were different between each
line.
2014-05-25 15:52:36 +01:00
Ben S
4d1aea12b0 Add colouring for media and compressed files 2014-05-24 20:40:31 +01:00
Ben S
7063c21ba0 Actually, cache the calls to ext
They get computed often enough for this to be worthwhile, and I have plans for using the extension even if it's not what's being sorted by.
2014-05-24 02:36:00 +01:00
Ben S
184de0ce79 Allow sorting by file extension 2014-05-24 02:32:57 +01:00
Ben S
cb1b8bc2d7 Add sort option
And move options struct into its own module
2014-05-24 02:17:43 +01:00
Ben S
fdf58e887b Upgrade to latest Rust (s/~str/StrBuf/)
See https://github.com/mozilla/rust/pull/14310
2014-05-24 01:14:40 +01:00
Ben S
87f0bdea9e Print numeric UIDs and GIDs if they don't map to anything 2014-05-22 13:26:13 +01:00
Ben S
818fc615a8 Upgrade to latest Rust nightly 2014-05-22 13:17:33 +01:00
Ben S
d76fee7328 Add user and group columns
This meant writing some libc interaction, which wasn't actually too bad.
2014-05-05 11:29:50 +01:00
Ben S
d6e34723b9 Upgrade to latest Rust nightly
Replace ~strs with either &'static strs or .to_owned() strs where appropriate
Fields now seem to be private by default - good!
2014-05-05 10:51:24 +01:00
Ben S
10b8f6f414 Split source out into multiple files
Also, reverse the way columns are rendered: before, a column took a stat and a name to render; now, a file takes a column type to render. This means that most of the File data/methods can be private.
2014-05-04 21:33:14 +01:00