Commit Graph

16 Commits

Author SHA1 Message Date
Ben S
ff0bef66e5 Cache the lengths of formatting-striped fields
The code could do with some comments, but it works.
2014-05-25 17:14:50 +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
d60c2ce839 Add reverse parameter 2014-05-24 21:45:24 +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
a0582132e5 Have each row use the same column widths
This involves putting the entire output into a table before anything
is actually printed, in order to determine what the width of each
column should be. This should make it appear to output slower, as the
first line can only be printed after every file has been examined, but
it's still fast to me.
2014-05-22 13:22:41 +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
e4cee37805 Fix various warnings 2014-05-04 21:35:10 +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
Ben S
e0fc84e869 Add --all command-line option
Also add command-line-option-handling code.
2014-05-04 17:01:54 +01:00
Ben S
af7689eb0b Keep files and their stat results together
Thanks to #rust for helping me diagnose lifetime problems!
2014-05-04 16:28:42 +01:00
Ben S
688e41e401 Add file size column 2014-05-03 14:26:49 +01:00
Ben S
aef325bde9 Make columns more generic 2014-05-03 14:00:50 +01:00
Ben S
dc9668c8d6 Initial commit 2014-05-03 11:30:37 +01:00