1. 17 4月, 2016 1 次提交
    • B
      Source file rearrangements · efa372cb
      Benjamin Sago 提交于
      This commit moves file, dir, and the feature modules into one parent 'fs' module. Now there are three main 'areas' of the code: main and options, the filesystem-touching code, and the output-displaying code.
      
      It should be the case that nothing in 'output' touches 'std::fs'.
      efa372cb
  2. 11 4月, 2016 1 次提交
  3. 01 4月, 2016 1 次提交
    • B
      Use only the time zone data present on the system · ee4c09dd
      Ben S 提交于
      Thinking about it, it doesn't make sense to use an *external* time zone source when the program we want to compare it to, ls, uses the system one. So just use the system one.
      
      Also, handle the case where the time zone data file can't be loaded by showing the files in UTC rather than falling over and quitting.
      ee4c09dd
  4. 11 2月, 2016 1 次提交
  5. 10 2月, 2016 1 次提交
    • B
      Update packages to latest versions · 75b2748a
      Ben S 提交于
      - Users v0.5.1, which renames OSUsers to UsersCache
      - Locale v0.2, which returns to libc v0.1
      - Datetime v0.4.2, which mimics the locale update, and puts timezone definitions in:
      - Zoneinfo-data, which is needed to obtain the current timezone
      75b2748a
  6. 20 12月, 2015 1 次提交
    • B
      Move colours module into output · 1b3492ce
      Benjamin Sago 提交于
      This commit moves the colours module to be a sub-module of the output one.
      This makes sense because finding which colour a certain file should be is only
      done during output, and (I think) the only places that the `Colours` struct's
      fields are ever queried is from the output module.
      
      The only casualty was that the `file_colour` from the filetype module had to
      be moved, as determining colours is no longer part of that module - only
      determining filetype is. So it now reflects its name!
      1b3492ce
  7. 17 12月, 2015 1 次提交
    • B
      Replace Cells with growable TextCells · c911b5f6
      Benjamin Sago 提交于
      A recent change to ansi-term [1] means that `ANSIString`s can now hold either
      owned *or* borrowed data (Rust calls this the Cow type). This means that we
      can delay formatting ANSIStrings into ANSI-control-code-formatted strings
      until it's absolutely necessary. The process for doing this was:
      
      1. Replace the `Cell` type with a `TextCell` type that holds a vector of
         `ANSIString` values instead of a formatted string. It still does the
         width tracking.
      
      2. Rework the details module's `render` functions to emit values of this
         type.
      
      3. Similarly, rework the functions that produce cells containing filenames
         to use a `File` value's `name` field, which is an owned `String` that
         can now be re-used.
      
      4. Update the printing, formatting, and width-calculating code in the
         details and grid-details views to produce a table by adding vectors
         together instead of adding strings together, delaying the formatting as
         long as it can.
      
      This results in fewer allocations (as fewer `String` values are produced), and
      makes the API tidier (as fewer `String` values are being passed around without
      having their contents specified).
      
      This also paves the way to Windows support, or at least support for
      non-ANSI terminals: by delaying the time until strings are formatted,
      it'll now be easier to change *how* they are formatted.
      
      Casualties include:
      
      - Bump to ansi_term v0.7.1, which impls `PartialEq` and `Debug` on
        `ANSIString`.
      - The grid_details and lines views now need to take a vector of files, rather
        than a borrowed slice, so the filename cells produced now own the filename
        strings that get taken from files.
      - Fixed the signature of `File#link_target` to specify that the
        file produced refers to the same directory, rather than some phantom
        directory with the same lifetime as the file. (This was wrong from the
        start, but it broke nothing until now)
      
      References:
      
      [1]: ansi-term@f6a6579ba8174de1cae64d181ec04af32ba2a4f0
      c911b5f6
  8. 16 11月, 2015 1 次提交
    • B
      Use lazy_static to cache datetime formats · e07992d0
      Ben S 提交于
      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.
      e07992d0
  9. 15 11月, 2015 2 次提交
    • B
      Avoid cloning the file names vector · ca65c981
      Ben S 提交于
      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.
      ca65c981
    • B
      Move many Options structs to the output module · 10468797
      Ben S 提交于
      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.
      10468797
  10. 04 11月, 2015 3 次提交
  11. 03 11月, 2015 1 次提交
  12. 06 9月, 2015 1 次提交
  13. 04 9月, 2015 3 次提交
  14. 03 9月, 2015 2 次提交
    • B
      It's hardly worth giving Exa its own constructor · a14f1d82
      Ben S 提交于
      a14f1d82
    • B
      Parallelise the details view! · 4e49b91d
      Ben S 提交于
      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 :)
      4e49b91d
  15. 26 8月, 2015 1 次提交
    • B
      Scan for nested files on-demand, not all the time · b5edee53
      Ben S 提交于
      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.
      b5edee53
  16. 25 8月, 2015 2 次提交
    • B
      Display errors inline in the tree · 2a9b6fe9
      Ben S 提交于
      When tree mode is active, this will print out errors as another form of child node in the tree, instead of in one big block before any output.
      
      The 'this' field now holds the io::Result of the readdir call, rather than only a *successful* result.
      2a9b6fe9
    • B
      Make Dir return an Iterator of files, not Vec · 5d0bd371
      Ben S 提交于
      This is part of work to make the flow of files more iterator-able, rather than going in and out of vectors. Here, a Dir returns an iterator of files, rather than a pre-filled vector.
      
      For now, this removes the ability for error messages to be displayed. Will be added in later though!
      5d0bd371
  17. 04 8月, 2015 1 次提交
    • B
      Fix bug where Git repos were always queried · d547c3f5
      Ben S 提交于
      This is very slow (see #28) at the moment, so there's an option to switch off repo discovery. However, they were still always being queried. Now, if there's no Git option in the flags, it won't try to discover a repo.
      d547c3f5
  18. 02 8月, 2015 1 次提交
    • B
      Use new slice_splits functions · 21ee2fbb
      Ben S 提交于
      These replace `init()` and `tail()` which are deprecated in favour of these.
      
      In fact, it's a good thing they're deprecated, because part of the path_prefix code involved working around a call to init() that would panic otherwise - doing the same check with an `Option` is much more ergonomic.
      21ee2fbb
  19. 28 6月, 2015 1 次提交
    • B
      Add --grid --long option · ccdf9ff4
      Ben S 提交于
      This commit adds --grid, which, when used with --long, will split the details into multiple columns. Currently this is just 2 columns, but in the future it will be based on the width of the terminal.
      
      In order to do this, I had to do two things:
      
      1. Add a `links` parameter to the filename function, which disables the printing of the arrow and link target in the details view. When this is active, the columns get way too large, and it becomes not worth it.
      2. Change the `print_table` function from actually printing the table to stdout to returning a list of `Cells` based on the table. This list then gets its width measured to calculate the width of the resulting table.
      ccdf9ff4
  20. 23 6月, 2015 1 次提交
  21. 21 6月, 2015 1 次提交
  22. 18 6月, 2015 1 次提交
  23. 09 6月, 2015 1 次提交
  24. 05 6月, 2015 1 次提交
  25. 21 5月, 2015 1 次提交
  26. 17 5月, 2015 1 次提交
  27. 16 5月, 2015 1 次提交
  28. 12 5月, 2015 1 次提交
  29. 10 5月, 2015 1 次提交
    • B
      Add colours module, and disable them sometimes · 36116a14
      Ben S 提交于
      Colours are now disabled when output is not to a terminal. Fixes #53!
      
      This required some internal restructuring - colours are now in their own object that gets passed around everywhere it's needed.
      36116a14
  30. 08 5月, 2015 1 次提交
  31. 03 5月, 2015 3 次提交