summaryrefslogtreecommitdiffstats
path: root/src/output
AgeCommit message (Collapse)Author
2015-09-21Upgrade to latest version of datetime crateBen S
- VariableOffset -> TimeZone::VariableOffset
2015-09-15Dismiss some compile-time warningsBenjamin Sago
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-03Details view comments and tidy-upsBen S
2015-09-02Parallelise the details view!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 :)
2015-08-26Restore xattrs to their long view columnBen S
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-26Use the correct ASCII for rows with errors/attrsBen S
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-26Scan for nested files on-demand, not all the timeBen 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.
2015-08-26Print xattrs in tree view like we do errorsBen S
This changes the way extended attributes (xattrs) are printed. Before, they were artificially printed out on their own line both in lines mode *and* details mode, which looked a bit weird. Now, they are additional 'child nodes' of that item that get printed alongside errors. All this allows all the 'extra info' that is going to be present for very few entries to be consolidated and listed in the same way, without resorting to extra printlns. As a great side-effect, it allows taking out some of the more redundant code in the Table impl -- it is now *always* going to be in create-child-nodes mode, as *any* file now can, not only when we have the --tree flag in use. Also, it now actually displays errors when failing to read the extended attributes, such as if the user doesn't have permission to read them. The extended attribute flag has been temporarily disabled while I work out the best way to do it!
2015-08-25Coalesce platform-specific xattr modulesBen S
Now we have one Ur-module that contains functionality common to both supported platforms. The benefits of doing it this way are that: 1. It doesn't implement a dummy interface - rather, there will be less code generated when the feature is not present; 2. The code shared between them can be kept in sync. The other two modules were something like 80% the same.
2015-08-25Fix bug where errors' tree parts ended earlyBen S
Have to collect the results into a Vec in order to make sure we only do the ending part for the last one.
2015-08-25Display errors inline in the treeBen 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.
2015-08-25Comment correctionsBen S
2015-08-25Make the cells optional for display Rows.Ben S
This will be used to not provide any information for the rows that will have no data (attributes, errors).
2015-08-25Make Dir return an Iterator of files, not VecBen 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!
2015-08-03Allow --tree without --longBen S
This kind of abuses the details view by giving it no columns when the Columns value is None (it's now Optional).
2015-08-03Slim down symlink arrowBen S
Fixes #74. There's one argument for changing the arrow, and none against!
2015-07-15Updates for term-gridBen S
The separator_width field in the term_grid crate was replaced with a filling field.
2015-06-29Extract some methodsBen S
2015-06-29Allow using --across with --long --gridBen S
2015-06-28Fix bug where unfilled displays were being checkedBen S
2015-06-28Cache the rendered cellsBen S
Previously, each time it tried to render a table (to check its width), it both re-queried the filesystem and re-formatted the values into coloured strings. These values are now calculated only once before the table is drawn, and are used repeatedly throughout. Although it looks as though there's more `clone()`ing going on than before, it used to be recalculating things and storing them as vectors anyway, so the memory would still be used in any case.
2015-06-28Go top-to-bottom, not left-to-rightBen S
2015-06-28Adapt the long grid view to the console widthBen S
2015-06-28Add --grid --long optionBen 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.
2015-06-23Use term_grid crate for grid formattingBen S
Fixes #39!
2015-06-08Various unimportant style changesBen S
2015-06-04Display dates with the host's timezoneBen S
Fixes #54 using the datetime crate's spiffy new time zone ability.
2015-05-29Fix failing test codeBen S
2015-05-16Generify Table to be used in tests once againBen S
Finally! The benefit of having all the field-rendering code (in details.rs) separate from the value-getting code (in file.rs) is that rendering them can be tested again.
2015-05-16Add some more comments and spacingsBen S
2015-05-16Remove space when no file has extended attributesBen S
There would be an extra column, and it looked unsightly. Unsightly! This also removes the last specific style from the details view (Plain).
2015-05-12Move Git render_char to its own methodBen S
2015-05-12Fix Git colours to be actually correctBen S
2015-05-12Move File fields to their own moduleBen S
2015-05-12Minor whitespace changesBen S
2015-05-12The locals struct is no longer necessaryBen S
2015-05-12Remove year field on timestamp columnBen S
It's now in the locals of the Table struct, and didn't really belong in the column anyway.
2015-05-12Move size_format into render_size methodBen S
The benefit of having these all as separate methods instead of using the same trait is that we can just pass parameters in like this!
2015-05-12Remove redundant importsBen S
2015-05-12Move renderers from traits to Table objectBen S
2015-05-11Fix size numbers boldingBen S
2015-05-11Make executable files' 'x's underlined againBen S
2015-05-11Add the file type column back inBen S
2015-05-11Turn File into simply a data sourceBen S
And move all the rendering, ansi_term, colourful stuff into the output modules, which is the only place they should be used!
2015-05-10Finally, do the same for the Git column.Ben S
2015-05-10Update most of the other columns to use coloursBen S
2015-05-09Add colours module, and disable them sometimesBen 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.
2015-05-07Remove some unused functionsBen S
2015-04-09updated to latest rust nightlyCristian Kubis
2015-04-04Upgrade to latest RustBenjamin Sago
Still missing a few Beta features, but it compiles! - Copy requires Clone - current_dir returns a Path now - num_cpus moved to a crate