summaryrefslogtreecommitdiffstats
path: root/src/options.rs
AgeCommit message (Collapse)Author
2015-09-04Make sure we check the ioctl term size resultBen S
2015-09-04Remove pad crate and unnecessary qualificationsBen 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-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-03Fix bug where Git repos were always queriedBen 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.
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-06-29Allow using --across with --long --gridBen S
2015-06-28Re-add missing failing option combinationsBen 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-17metadata.as_raw() is gone in nightlyMichael Neumann
2015-06-08Typo fixBen S
2015-06-08Various unimportant style changesBen S
2015-05-21Minuscule code cleanupBen 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 Default instances in OptionsBen S
2015-05-16Rename 'stat' -> 'metadata'Ben S
2015-05-12Lifetime-eliding action!Ben S
2015-05-12Minor whitespace changesBen 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-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-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-05-03Continue using new metadata fieldsBen S
2015-04-23Use new io + path + fs libraries (LOTS OF CHANGES)Ben S
Exa now uses the new IO, Path, and Filesystem libraries that have been out for a while now. Unfortunately, the new libraries don't *entirely* cover the range of the old libraries just yet: in particular, to become more cross-platform, the data in `UnstableFileStat` isn't available in the Unix `MetadataExt` yet. Much of this is contained in rust-lang/rfcs#1044 (which is due to be implemented in rust-lang/rust#14711), but it's not *entirely* there yet. As such, this commits a serious loss of functionality: no symlink viewing, no hard links or blocks, or users or groups. Also, some of the code could now be optimised. I just wanted to commit this to sort out most of the 'teething problems' of having a different path system in advance. Here's an example problem that took ages to fix for you, just because you read this far: when I first got exa to compile, it worked mostly fine, except calling `exa` by itself didn't list the current directory. I traced where the command-line options were being generated, to where files and directories were sorted, to where the threads were spawned... and the problem turned out to be that it was using the full path as the file name, rather than just the last component, and these paths happened to begin with `.`, so it thought they were dotfiles.
2015-04-07Fix panic when using --long without git supportBen S
Fixes #55.
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
2015-03-26Move all optional features into features moduleBen S
This module provides feature-specific implementations, and also dummy implementations for when they aren't supported by the system or OS. Doing it this way limits all the #[cfg(feature)] annotations, as we can now just include the module or not.
2015-03-11Merge pull request #49 from killercup/feature/group-is-useless-without-longBen S
Add "`--group` is useless without `--long`"
2015-03-10"`--group` is useless without `--long`"Pascal Hertleif
2015-03-10Git Column is Useless Without `--long`Pascal Hertleif
2015-03-10Make Git Column OptionalPascal Hertleif
Closes #47
2015-03-02Add --version command (and bump version)v0.2.0Ben S
2015-02-26Add --group-directories-first optionBen S
Closes #27.
2015-02-26details: `filter` is only used when recursingBen S
So move it as part of 'recurse's option.
2015-02-26Refactor details viewBen S
Move most of the heavy lifting into a Table struct, which doesn't govern how the resulting table is *created*, only how it's *displayed*.
2015-02-24Add extra special error for --levelBen S
2015-02-24Remove debugging printBen S
Everybody does it, right?
2015-02-24Add --level option to limit tree and recursionBen S
2015-02-23Allow --tree without --recurseBen S
See #24
2015-02-23Merge branch 'nwin:add-xattr-linux'Ben S
Conflicts: src/file.rs
2015-02-23Fixed tests.nwin
2015-02-23Fix --sort=extCorey Ford
The logic of the previous version wasn't correct. Also, presuming natural ordering of full filenames is still reasonable when the extensions are identical.
2015-02-22Get rid of explicit `as_slice()` calls.Steven Allen
2015-02-22Rename attr to xattrnwin
2015-02-22Fix other platforms than macos.nwin
2015-02-22Implement display of extended attributesnwin
2015-02-22Add sort-by-date optionsBen S
These were completely missing because I forgot about them... I added sorting functionality before I added date functionality, but it turns out I didn't even need the datetime library to do this! However, this implementation feels incomplete. If you sort by the accessed date, it still displays the modified date, so the dates still look out of order. If I were to change the date column for the user, though, then there would still be no header to signify that the column has changed. I'm not sure how to proceed with this, but this is still missing functionality, so in it goes.
2015-02-21Mandate --recurse with --treeBen S
Fixes #7.
2015-02-10Format file size in bytes with the user's localeBen S
Use the `locale` crate as a dependency to read in the set thousands-separator character, and pass this to the file size column, which uses it to add the separators in. en_GB uses "," fr_FR uses "" and just displays the numbers in one go.