Commit Graph

31 Commits

Author SHA1 Message Date
Ben S
d71140079b Missed a feature flag... 2015-03-22 19:54:12 +00:00
Ben S
134f9fc252 Refactor details view
Move most of the heavy lifting into a Table struct, which doesn't govern how the resulting table is *created*, only how it's *displayed*.
2015-02-26 07:18:08 +00:00
Ben S
ce23c63d75 Merge branch 'nwin:add-xattr-linux'
Conflicts:
	src/file.rs
2015-02-23 14:52:07 +00:00
Ben S
ae39d0f8a7 Merge pull request #19 from Stebalien/replace-as_slice
Get rid of explicit `as_slice()` calls
2015-02-22 23:50:38 +00:00
nwin
beaf8789ce true -> false 2015-02-23 00:08:44 +01:00
nwin
8ac16fad8a Using convenience method and using extended clusters as recommended. 2015-02-22 18:36:11 +01:00
Steven Allen
2b5406842f Get rid of explicit as_slice() calls. 2015-02-22 12:11:33 -05:00
nwin
df909272a1 Count the number of grapheme clusters to determine the cell length. 2015-02-22 17:21:57 +01:00
nwin
376e417c3f Replace &String with &str 2015-02-22 13:26:20 +01:00
Ben S
8b520edf3d Only display the year if it's last year
Otherwise, just display the hour and minute.
2015-02-09 18:14:05 +00:00
Ben S
0d25a90ef1 Initial work on date/time columns for files
Using the datetime crate, add an extra column to the --long view that
prints out the modified, accessed, or created timestamp for each file.
Also, let the user pick which one they want to see based on the --time
command-line option.
2015-02-09 16:33:27 +00:00
Ben S
42ae7b3d33 Refactor the code after tree view changes
- Turn the views and main program loop into structs, rather than just as one gigantic function
- Separate views into their own files

The addition of the git column and the tree view meant that a lot of functions now just took extra arguments that didn't seem to fit. For example, it didn't really work to have only one 'view' method that printed out everything, as the different view options now all take different parameters.
2015-02-05 14:39:56 +00:00
Ben S
827a1e11fd Make filename not a column
FileName was always a special-cased column, as it was assumed to be the last column in the output. Now, it's explicitly marked as such. This allows the hash marks to be placed before the filename, rather than at the start of the line.
2015-02-03 13:48:39 +00:00
Ben S
90d4684de4 Preliminary Git support!
This is something that I've long wanted to add. It uses libgit2 as an optional dependency.
2015-01-27 15:01:17 +00:00
Ben S
22a4dc90b9 Update #[derive] names 2015-01-26 00:27:06 +00:00
Benjamin Sago
191c0e5b90 Test highlighting of usernames 2015-01-25 13:04:15 +00:00
Benjamin Sago
449592c150 Do column width calculations ourselves (speedup)
Instead of stripping the ANSI formatting characters from our strings, work out the length without them and use that. This is per-column, but most of them are simple (just the same number of characters in the non-coloured string).

Sometimes, this is really simple: for example, trwxrwxrwx permissions strings are always going to be ten characters long, and the strings that get returned are chock full of ANSI escape codes.

This should have a small benefit on performance.
2015-01-24 17:26:26 +00:00
Ben S
2ba0b3bd5f Convert docs to standard format 2015-01-24 12:38:05 +00:00
Benjamin Sago
728e7dd976 Forbid certain argument combinations 2015-01-13 00:31:30 +01:00
Benjamin Sago
1ec4451016 rm trailing whitespace 2015-01-12 22:46:04 +01:00
Benjamin Sago
1c5409e253 Upgrade to Rust alpha
- uint -> usize
- getopts Cargo library
- replace feature gates with unstable APIs
2015-01-12 01:31:24 +01:00
Ben S
e3a8342173 Upgrade code and libraries to latest Rust
std::str changes, and the way macros are expanded.
2014-12-24 04:31:59 +00:00
Ben S
a871a448be Add --bytes to not use prefixes at all 2014-12-18 07:04:31 +00:00
Ben S
24628f97be Use number_prefix crate for number prefixes 2014-12-18 07:00:31 +00:00
Ben S
224849b0e9 Make copyable values copyable 2014-12-14 18:23:06 +00:00
Ben S
66339e7a15 Miscellaneous little optimisations
- Prefer iter over into_iter where appropriate
- Cut down on cloning
2014-12-12 14:06:48 +00:00
Ben S
5b7124bb71 I like aligning things 2014-11-24 02:13:54 +00:00
Ben S
d72be30c30 Reduce unnecessary String allocations
- Remove uses of to_string() on a &str where it wasn't necessary
- Use SendStr to reduce allocations further
2014-11-24 02:01:08 +00:00
Ben S
933f98d2c3 Upgrade to latest Rust nightly 2014-11-23 21:29:11 +00:00
Ben S
eecfd88363 Simplify alignment code 2014-06-30 09:59:54 +01:00
Ben S
a8465fed45 Move to Cargo 2014-06-28 17:24:20 +01:00