Commit Graph

303 Commits

Author SHA1 Message Date
Ben S
d77e43bb9b Merge branch 'master' of github.com:ogham/exa 2015-05-26 14:22:58 +01:00
Markus Engelbrecht
5caa6dd924 fix compile errors if git support is disabled 2015-05-24 12:05:44 +02:00
Ben S
0c66d15345 Minuscule code cleanup 2015-05-21 16:09:26 +01:00
Ben S
31ce5b27ab StatResult::Path -> Dir 2015-05-21 16:09:16 +01:00
Ben S
50442a0bfe Generify Table to be used in tests once again
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-16 21:02:28 +01:00
Ben S
8e7efed3f5 Add Default instances in Options 2015-05-16 18:34:05 +01:00
Ben S
5ffff841e0 Replace the tests for File with the working subset 2015-05-16 18:33:08 +01:00
Ben S
a687dc936e Rename 'stat' -> 'metadata' 2015-05-16 18:16:35 +01:00
Ben S
fcc864eb67 Add some more comments and spacings 2015-05-16 16:10:58 +01:00
Ben S
1bb7a4e47e Remove space when no file has extended attributes
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-16 14:30:01 +01:00
Ben S
2594690aff Start using the libc crate from crates.io 2015-05-16 13:17:50 +01:00
Ben S
00ae71850b Lifetime-renaming action! 2015-05-12 15:38:12 +01:00
Ben S
07ff10e550 Lifetime-eliding action! 2015-05-12 15:37:59 +01:00
Ben S
c9a3affb4c Move Git render_char to its own method 2015-05-12 03:36:47 +01:00
Ben S
e2f2bd69de Fix Git colours to be actually correct 2015-05-12 03:34:52 +01:00
Ben S
085067d18e Move File fields to their own module 2015-05-12 03:33:40 +01:00
Ben S
2a3045ddfa Minor whitespace changes 2015-05-12 03:14:56 +01:00
Ben S
b0d4c9728f Where do all these tabs keep coming from? 2015-05-12 03:08:24 +01:00
Ben S
fafeda771d The locals struct is no longer necessary 2015-05-12 03:07:16 +01:00
Ben S
5af0f5793e Remove year field on timestamp column
It's now in the locals of the Table struct, and didn't really belong in the column anyway.
2015-05-12 03:02:38 +01:00
Ben S
7f48748e70 Move size_format into render_size method
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-12 03:00:18 +01:00
Ben S
02ba026763 Remove redundant imports 2015-05-12 02:59:22 +01:00
Ben S
4a43aa8db1 Move renderers from traits to Table object 2015-05-12 02:54:34 +01:00
Ben S
6068f2dd86 Fix size numbers bolding 2015-05-11 23:58:40 +01:00
Ben S
898b89b8fd Make executable files' 'x's underlined again 2015-05-11 23:57:29 +01:00
Ben S
f6915c1f87 Add the file type column back in 2015-05-11 23:44:52 +01:00
Ben S
dc6599b1b3 Turn File into simply a data source
And move all the rendering, ansi_term, colourful stuff into the output modules, which is the only place they should be used!
2015-05-11 23:28:01 +01:00
Ben S
c6d8c21e80 Finally, do the same for the Git column. 2015-05-10 18:03:15 +01:00
Ben S
d9319c48b4 Do the same for the Git column 2015-05-10 17:57:21 +01:00
Ben S
5a37d1b6b1 Update most of the other columns to use colours 2015-05-10 12:50:20 +01:00
Ben S
627bca98ef Move file type colours to their own struct 2015-05-10 00:22:58 +01:00
Ben S
89dd5c1239 Straighten quotes 2015-05-10 00:13:00 +01:00
Ben S
36116a1420 Add colours module, and disable them sometimes
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-09 23:57:18 +01:00
Ben S
da49b80c35 Clean up filetype-detecting code 2015-05-09 16:10:26 +01:00
Ben S
662aed302a Remove some unused functions 2015-05-07 22:29:24 +01:00
Ben S
b4529671b8 Highlight executable files in green
This was intended from the start, but the dead_code checker was dulled by the module being public!
2015-05-07 22:27:33 +01:00
Ben S
9d1aadc808 The modules don't actually need to be public 2015-05-07 22:20:24 +01:00
Ben S
910693f921 The timestamp fields are now in seconds!
Fixes #62.
2015-05-06 21:47:04 +01:00
Ben S
5887aa8cde Remove broken conversion 2015-05-03 16:40:39 +01:00
Ben S
42a347c063 Use OS-defined permission bits type 2015-05-03 16:35:44 +01:00
Ben S
8eaa4c550c Continue using new metadata fields 2015-05-03 16:25:53 +01:00
Ben S
06ef372560 Remove unused feature gates 2015-05-03 14:57:56 +01:00
Ben S
64b97aa9f3 Start following symlinks again
This was my favourite feature, so I'm glad to see it back!
2015-05-03 13:10:25 +01:00
Ben S
41aadaeab4 Re-implement no-longer-missing metadata fields 2015-05-03 12:46:05 +01:00
Ben S
d7a2974494 Permissions are back! 2015-05-03 11:55:10 +01:00
Ben S
be8a48ab72 This comment is no longer relevant 2015-05-03 11:51:57 +01:00
Ben S
c642f8cbbd Update the type of Unix permission bits 2015-05-03 11:47:34 +01:00
Ben S
eb8affac9c Temporarily disable tests (!) 2015-04-23 13:47:46 +01:00
Ben S
d7d11f77f3 Use unicode_width crate 2015-04-23 13:46:37 +01:00
Ben S
adbaa51cb9 Use new io + path + fs libraries (LOTS OF CHANGES)
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-23 13:00:34 +01:00
Cristian Kubis
0751b009ca updated to latest rust nightly 2015-04-09 10:59:06 +02:00
Ben S
fc188935cd Fix panic when using --long without git support
Fixes #55.
2015-04-07 02:40:15 +01:00
Benjamin Sago
f885568145 Upgrade to latest Rust
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-04-04 00:14:56 +02:00
Ben S
2ffa64cff6 Move all optional features into features module
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-26 00:37:12 +00:00
Ben S
d71140079b Missed a feature flag... 2015-03-22 19:54:12 +00:00
Ben S
9c2858e447 Upgrade to latest Rust
- old_path::Path isn't imported by default anymore
- range -> ..
2015-03-22 19:46:45 +00:00
Eirik Schwenke
8b2a19046e The path_filename function/method isn't declared public. If the declaration is changed, rustc complains about a conflict. This seems to be the minimal change needed for tests to run. 2015-03-22 08:50:15 +01:00
Eirik Schwenke
30a48e05c2 Apparently std::os::unix::osStrExt is now std::os::unix::ffi::OsStrExt. 2015-03-22 08:48:05 +01:00
Ben S
7407cf1766 Merge branch 'master' of github.com:ogham/exa 2015-03-11 15:09:50 +00:00
Ben S
860e19d292 Merge pull request #49 from killercup/feature/group-is-useless-without-long
Add "`--group` is useless without `--long`"
2015-03-11 14:56:34 +00:00
Pascal Hertleif
a4459da6ad "--group is useless without --long" 2015-03-10 19:00:52 +01:00
Pascal Hertleif
5d152dbe15 Git Column is Useless Without --long 2015-03-10 18:56:38 +01:00
Pascal Hertleif
7dc3a02185 Make Git Column Optional
Closes #47
2015-03-10 18:36:29 +01:00
Ben S
f12da1ea4c Simplify compiled file checking code 2015-03-07 23:51:13 +00:00
Ben S
3e7357819b Simplify filetype detection code 2015-03-07 23:46:48 +00:00
Ben S
cf38f90aa9 Sweep deprecated warnings under the rug 2015-03-07 23:01:57 +00:00
bp
9f9b8ca33e clean up consumer to make code more readable 2015-03-03 22:57:48 -05:00
bp
d9a0458a39 fix bug where a failed stat would cause the consumer thread to hang 2015-03-03 22:41:30 -05:00
bp
53a723b4ba making Exa.load() stat files in parallel 2015-03-03 21:48:36 -05:00
Ben S
67f60e614b Add --version command (and bump version) 2015-03-02 14:54:38 +00:00
Ben S
369a421359 Temporary workaround for Path in libgit2-rs 2015-03-02 03:18:26 +00:00
Ben S
9e7c80bcd0 Upgrade to latest Rust
- env is no longer feature gated
- exit_status is!
2015-03-02 01:59:43 +00:00
Ben S
027ca60d90 current_dir -> getcwd
current_dir returns a new PathBuf, but getcwd returns an old Path. One day I'll have to upgrade to the new Path library. One day.

Fixes #41.
2015-03-01 13:50:15 +00:00
Ben S
ff1f6d0087 Add --group-directories-first option
Closes #27.
2015-02-26 14:05:26 +00:00
Ben S
8615f44076 Spew comments everywhere 2015-02-26 08:27:29 +00:00
Ben S
571be76454 The Row struct's fields don't need to be pub 2015-02-26 07:42:58 +00:00
Ben S
8139cfedea Fewer warnings when testing 2015-02-26 07:42:37 +00:00
Ben S
f9f1c991cb details: filter is only used when recursing
So move it as part of 'recurse's option.
2015-02-26 07:26:04 +00:00
Ben S
abf7bf7a3e We don't use plugin anymore 2015-02-26 07:18:18 +00:00
Ben S
134f9fc252 Refactor details view
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-26 07:18:08 +00:00
Ben S
93b17a6308 Add extra special error for --level 2015-02-24 16:19:56 +00:00
Ben S
17657100b4 Fix bug where the wrong level was used for . dir 2015-02-24 16:08:22 +00:00
Ben S
cbc3640ced Remove debugging print
Everybody does it, right?
2015-02-24 16:07:31 +00:00
Ben S
f505bdc869 Add --level option to limit tree and recursion 2015-02-24 16:05:25 +00:00
Jonny Gilchrist
96cab9cd05 Fix a missing '/' in symlink targets
In cases where symlink targets were more than a single directory down,
exa did not print the '/' targets when separating directories, resulting
in the following output:

    symlink => dirAdirBdirC/file

Instead of

    symlink => dirA/dirB/dirC/file

By adding a '/' character after each component of the filename, this
error is fixed.
2015-02-24 03:28:34 +00:00
Ben S
ea1b3caefa Allow --tree without --recurse
See #24
2015-02-23 16:08:51 +00:00
Ben S
ce23c63d75 Merge branch 'nwin:add-xattr-linux'
Conflicts:
	src/file.rs
2015-02-23 14:52:07 +00:00
Ben S
38a785426b Fix overflowing UIDs and GIDs
Fixes #26.
2015-02-23 13:37:59 +00:00
Ben S
1da1142a7e Fix panic when previewing symlink to ., .., or /
The old implementation blindly assumed that a symlink target would have a directory compoment, which the current directory, parent directory, and root directory technically don't have.

Fixes #20.
2015-02-23 11:32:35 +00:00
nwin
586c7dd30b Make the naming of variables more obvious. 2015-02-23 10:00:58 +01:00
nwin
1ab1f3f320 Add xattr support for linux 2015-02-23 09:48:26 +01:00
nwin
f44711cfd0 Fixed tests. 2015-02-23 08:30:58 +01:00
Ben S
e21dc9af2a Merge pull request #21 from coyotebush/git-paths
Improve matching of Git status entries to files
2015-02-23 00:46:36 +00:00
Corey Ford
ee20c5d8bb Fix --sort=ext
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-23 00:06:43 +00:00
Ben S
ae39d0f8a7 Merge pull request #19 from Stebalien/replace-as_slice
Get rid of explicit `as_slice()` calls
2015-02-22 23:50:38 +00:00
Ben S
bd8e73b212 Merge pull request #17 from nwin/fix-column-alignment
Fix the column alignment
2015-02-22 23:48:30 +00:00
nwin
beaf8789ce true -> false 2015-02-23 00:08:44 +01:00
Corey Ford
6e19563879 Improve matching of Git status entries to files
The challenge is that the paths returned from libgit2's status listing
are from the perspective of the Git repository and thus effectively
relative to the working tree root, while the other paths we're
manipulating are (potentially) relative to our current working
directory. So, if those two aren't identical (if running from outside
the working tree, or from a subdirectory), the paths won't match up.

A reasonably reliable way around this is to resolve both types of paths
to absolute paths before comparing them. This fixes #15 at a basic
level, anyway.

What still doesn't work: referring to the working tree or one of its
descendants via a symlink. For that, we'd probably need to fully resolve
symlinks in the file path.

(The unwrap_or()'s are messy and will probably just result in missing
status information, but then, what information could you hope to get
without having both a current working directory and a Git working tree?)
2015-02-22 14:44:54 -08:00
nwin
0082563e47 Using the same alignment as ls. 2015-02-22 18:50:52 +01:00
nwin
8ac16fad8a Using convenience method and using extended clusters as recommended. 2015-02-22 18:36:11 +01:00