Commit Graph

956 Commits

Author SHA1 Message Date
Ben S
ca65c981f1 Avoid cloning the file names vector
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.
2015-11-15 15:52:55 +00:00
Ben S
2efaf7ec45 Options and FileFilter are also deducible
We may as well use this trait now that it’s available!
2015-11-15 15:07:19 +00:00
Ben S
534d3c3fa5 Extract 'bad argument' method 2015-11-15 00:02:39 +00:00
Ben S
8b9f074d63 Inline SortField::from_word
With the new OptionSet trait, the from_word constructor doesn't really do much by itself.
2015-11-14 23:47:13 +00:00
Ben S
10468797bb Move many Options structs to the output module
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.
2015-11-14 23:32:57 +00:00
Ben S
cc04d0452f Pin versions to those we know work 2015-11-04 17:01:05 +00:00
Benjamin Sago
caf5fce1e8 Merge pull request #85 from skade/move-to-stable
Move to stable
2015-11-04 16:31:05 +00:00
Florian Gilcher
30e4eb8b06 Fixup README version constraint 2015-11-04 16:27:51 +01:00
Florian Gilcher
c32ebdb904 Remove the other reference to nightly 2015-11-04 16:02:47 +01:00
Florian Gilcher
48d1e5164c Move file mode constants to a private module 2015-11-04 15:56:37 +01:00
Florian Gilcher
d083d26eaf Fix tree output 2015-11-04 15:22:51 +01:00
Florian Gilcher
77fa8974c4 Fixup: split prefix tests by property 2015-11-04 11:39:01 +01:00
Florian Gilcher
ad39d6e282 Test on nightly, beta and stable 2015-11-04 11:29:29 +01:00
Florian Gilcher
5556c6a40b Update README 2015-11-04 11:12:20 +01:00
Florian Gilcher
7a97b7d40c Reserve Vector elements instead of resizing 2015-11-04 11:07:31 +01:00
Florian Gilcher
7f53da73b7 Use slicing instead of future slice_last 2015-11-04 11:07:08 +01:00
Florian Gilcher
e8ea96ee86 Avoid unstable c_string conversion features 2015-11-04 10:25:20 +01:00
Florian Gilcher
b3e3825417 Replace unstable fs_mode by internal constants 2015-11-04 09:51:34 +01:00
Florian Gilcher
679b9e18b2 Replace sum call by stable fold(0, Add::add) 2015-11-04 09:41:49 +01:00
Ben S
63bd929eb5 Upgrade to latest ansi_term
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.
2015-11-03 11:17:44 +00:00
Ben S
bc47073281 Feature slice_splits and vec_resize stabilised
As of rustc 1.6.0-nightly (1a2eaffb6 2015-10-31), anyway.
2015-11-03 11:16:19 +00:00
Ben S
1bebab78d0 Upgrade Rust version necessary 2015-10-30 10:40:56 +00:00
Ben S
8f4a2087e6 Version v0.4.0 2015-10-18 20:34:46 +01:00
Ben S
cfc8df12b6 Update the version of Rust that's required 2015-10-02 01:04:07 +01:00
Ben S
878d54111d Pin to git2-rs version 0.3
This should prove more stable than relying on a Git version.
2015-10-02 00:56:39 +01:00
Ben S
f7131a740b Fix warning when building on 64-bit systems
This warning was 'caused' by the previous commit (but it's small and easy to fix, so don't worry)
2015-10-02 00:56:09 +01:00
Ben S
9b3b00316f Merge pull request #81 from rhysd/fix-32bit
Fix integer length error on 32bit environment
2015-10-02 00:54:37 +01:00
rhysd
3dbc441c78 Fix integer length error on 32bit environment
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`.
```
2015-09-28 11:42:52 +09:00
Ben S
41fb02a02d Upgrade to latest version of datetime crate
- VariableOffset -> TimeZone::VariableOffset
2015-09-21 00:15:07 +01:00
Benjamin Sago
3d3acc2e93 Dismiss some compile-time warnings
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.
2015-09-15 20:05:27 +01:00
Benjamin Sago
12ab6bebc6 Versions bump (git2, winapi) 2015-09-15 20:04:21 +01:00
Ben S
8e9e6c50f5 Merge pull request #79 from mneumann/fix-dragonfly
This makes exa work on other platforms than linux and macosx.
2015-09-15 19:59:55 +01:00
Michael Neumann
6317417a98 This makes exa work on other platforms than linux and macosx. 2015-09-14 01:37:52 +02:00
Benjamin Sago
6cf9274828 Do not attempt to print nothing
This fixes a bug where an extra header line was printed when in --long --grid mode.
2015-09-05 17:40:02 +01:00
Ben S
65967355a8 Make sure we check the ioctl term size result 2015-09-04 11:30:46 +01:00
Ben S
d1e682b0c1 Remove pad crate and unnecessary qualifications 2015-09-04 11:20:13 +01:00
Ben S
f526d24911 Remove trivial cast 2015-09-04 11:17:59 +01:00
Ben S
fa51a87767 Merge branch 'parallel-details' 2015-09-03 18:50:09 +01:00
Ben S
456c516bee Add script to generate awkward testcases 2015-09-03 18:49:27 +01:00
Ben S
10fecbd7f6 Details view comments and tidy-ups 2015-09-03 18:48:53 +01:00
Ben S
a14f1d82f0 It's hardly worth giving Exa its own constructor 2015-09-03 13:38:18 +01:00
Ben S
83f05ffb3c Remove redundant attribute field 2015-09-03 13:38:06 +01:00
Ben S
4424a6df96 Rename readdir -> read_dir 2015-09-03 10:51:59 +01:00
Ben S
d089fcc1d8 Update rust-tz, amongst others 2015-09-02 23:23:23 +01:00
Ben S
4e49b91d23 Parallelise the details view!
This commit removes the threadpool in `main.rs` that stats each command-line argument separately, and replaces it with a *scoped* threadpool in `options/details.rs` that builds the table in parallel! Running this on my machine halves the execution time when tree-ing my entire home directory (which isn't exactly a common occurrence, but it's the only way to give exa a large running time)

The statting will be added back in parallel at a later stage. This was facilitated by the previous changes to recursion that made it easier to deal with.

There's a lot of large sweeping architectural changes. Here's a smattering of them:

- In `main.rs`, the files are now passed around as vectors of files rather than array slices of files. This is because `File`s aren't `Clone`, and the `Vec` is necessary to give away ownership of the files at the appropriate point.
- In the details view, files are now sorted *all* the time, rather than obeying the command-line order. As they're run in parallel, they have no guaranteed order anyway, so we *have* to sort them again. (I'm not sure if this should be the intended behaviour or not!) This means that the `Details` struct has to have the filter *all* the time, not only while recursing, so it's been moved out of the `recurse` field.
- We use `scoped_threadpool` over `threadpool`, a recent addition. It's only safely used on Nightly, which we're using anyway, so that's OK!
- Removed a bunch of out-of-date comments.

This also fixes #77, mainly by accident :)
2015-09-02 23:19:10 +01:00
Ben S
eee49ece04 Merge branch 'child-nodes' 2015-08-26 12:19:51 +01:00
Ben S
5f48bfd8b4 Propagate errors that occur during readdir
Fixes #71 - the I/O error should now be displayed as an error, rather than as a panic.

Also, fix some comments.
2015-08-26 12:19:23 +01:00
Ben S
5e1ff9cdcd Restore xattrs to their long view column
Had to thread the value in at display-time to get it to only query the attributes once!

This isn't the nicest way to do it, but this *is* a bit of an edge-case (it's the only thing where a column depends on something that gets calculated later)
2015-08-26 12:00:31 +01:00
Ben S
31dec1d1ba Use the correct ASCII for rows with errors/attrs
This prints three separate groups of child nodes: firstly the xattrs, then the errors, then any file children. It's done this way to only check for the 'last' child when necessary.
2015-08-26 11:36:10 +01:00
Ben S
b5edee53bd Scan for nested files on-demand, not all the time
This does a similar thing that we did with the xattrs, except with the nested files: it removes the 'this' field on File, and replaces it with a method (to_dir) that has the same effect.

This means we get to remove a bunch of 'recurse' fields and parameters that really had no business being there! Now the table doesn't need to know whether it's going to need to list files recursively or not.
2015-08-26 09:35:11 +01:00