The buggy code assumed that, if output isn't to a terminal, then the only view available is the Lines view. This is incorrect, as the Details view doesn't require a set width either, so check for --long even when there's no set width.
One of those two date formats was re-compiled before any date was displayed. Now they are compiled only the first time they're used, and cached versions are used thereafter, resulting in a speedup.
Instead of using the getopts crate’s dynamically-generated usage string, use a more static one:
- The options are organised by category now
- You can use `--help --long` to display only the ones that pertain to `--long`
- They’re aligned in a table sort of way
It could be generated statically, because all the options to change it are determined at compile time, but they’re not, yet...
Technically speaking, picking which timestamp to show for a file is a function of an output module, rather than the file itself. This also means that the `output::column` and `file` modules are now completely separate.
By taking the file names as a mutable vector, we can avoid having to allocate a new one when it’s empty. The recent changes to Options::getopts have made it more obvious that we could move the same vector out of getopts’s matches, instead of cloning it there.
This cleans up the options module, moving the structs that were *only* in use for the columns view out of it.
The new OptionSet trait is used to add the ‘deduce’ methods that used to be present on the values.
Changes to the way ANSIStrings work mean we need to dereference the strings before putting them in an ANSIString. There's more that can be done here, but this gets it to compile for now.
this commit fixes below type mismatch error:
```
src/output/details.rs:585:49: 585:60 error: mismatched types:
expected `i64`,
found `i32`
(expected i64,
found i32) [E0308]
src/output/details.rs:585 let date = self.tz.at(LocalDateTime::at(timestamp.0));
^~~~~~~~~~~
src/output/details.rs:585:49: 585:60 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to previous error
Could not compile `exa`.
```
The `unused_results` lint was complaining that the results of inserting into a `MockUsers` object weren't being inspected. These are mock users, so all that would be returned is `None` to indicate that they weren't already in the table -- they're fine to ignore! So, suppress the warnings for those two testing modules.