Add options -u, -U, and -m as shorthand options for displaying different
types of timestamp, not just one. It's possible to have more than one by
specifying more than one of these shorthands, but *not* when used with
--time, as this is only meant to display one at a time.
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.
- 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.
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.
There's still a lot to do, but this is actually *something*. The tree hierarchy is displayed using hashes at the start of a line. I want to have it just before the filename, but this will need some changes to the way that columns are handled.
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.