Commit Graph

124 Commits

Author SHA1 Message Date
Benjamin Sago
ef5fa90660 Display device IDs when listing devices
Override the size column for block and charater devices, so it shows the major and minor device IDs instead (which are in the Metadata struct somewhere).

This is what ls does when faced with a device.
2017-05-19 09:20:47 +01:00
Benjamin Sago
108a402dbd Re-prefix the paths found by following symlinks
Fixes #134, a bug that showed symlinks incorrectly as broken, but only when the file was listed directly on the command-line *and* the file was in a different directory to the one exa was being run in.

I’m not sure why the old code used `String::new()`, but it doesn’t seem to affect anything.
2017-05-15 22:38:23 +01:00
Benjamin Sago
205f18e848 It looks like you’re writing a letter 2017-05-07 17:39:01 +01:00
Benjamin Sago
4335f1978c Low-hanging clippy fruit 2017-05-07 17:15:22 +01:00
Benjamin Sago
39381bfb49 Document the recent changes 2017-05-07 15:14:06 +01:00
Benjamin Sago
9f6376a560 Give broken links a different style in grid view
Because the link style and status are now both available to the function that picks the colour style, we can have it highlight broken links differently.

Fixes #131.
2017-05-07 14:45:04 +01:00
Benjamin Sago
f14ee48658 Make FileTypeExt non-optional
We already use MetadataExt and PermissionsExt, so it already requires a Unix system — there’s no point providing fallback implementations if it wouldn’t build on those systems anyway.
2017-05-03 17:51:17 +01:00
Benjamin Sago
7b2e701b25 Replace hard-coded constants with libc ones 2017-05-03 10:05:16 +01:00
Benjamin Sago
395f9021ac Move these two imports down 2017-05-01 22:43:28 +01:00
Kevin Ballard
f8624ed308 Don't prepend current path to symlink targets
It's confusing, and `ls` doesn't do this either. We're not prepending
the current path to all of the directory entries, and the user is going
to interpret the symlink target as relative to the directory containing
the symlink.
2017-04-29 15:01:54 -07:00
Kevin Ballard
dd63774e37 Print . and .. components properly
`Path.file_name()` returns `None` if the path ends in `.` or `..`, which
causes e.g. `exa -d ..` to print a blank line.
2017-04-26 22:28:34 -07:00
Daniel Lockyer
cc4a65ac4b Remove lifetimes as they aren't needed 2017-03-31 17:12:20 +01:00
Daniel Lockyer
91459d608c Replace double-quote with single-quote 2017-03-31 17:10:18 +01:00
Daniel Lockyer
b68627ce1a Switch to padding reference as variable not consumed 2017-03-31 17:09:50 +01:00
Daniel Lockyer
e059fb5ba7 Remove unnecessary reference 2017-03-31 17:09:32 +01:00
Benjamin Sago
3bce55f569 Run Untry over the entire source tree 2017-03-26 17:35:50 +01:00
Ben S
74358c188a Properly handle errors when following a symlink
Fixes #123. The code assumes that every File that has its link_target() method called would first have been checked to make sure it’s actually a link first. Unfortunately it also assumed that the only thing that can go wrong while following a link is if the file wasn’t a link, meaning it crashes when given a link it doesn’t have permission to follow.

This makes the file_target() method able to return either a file or path for displaying, as before, but also an IO error for when things go wrong.
2016-10-29 20:27:23 +01:00
Linden Krouse
a9bb275250 Exa now recognizes pipes, devices, and sockets on unix systems. Fixes #112 2016-06-13 23:14:36 -04:00
Ben S
b8191670c7 Fix, and add tests for, slashes in link paths 2016-06-11 16:54:06 +01:00
Hendrik Sollich
c2d42e7d84 Fix building without default features 2016-05-03 00:03:22 +02:00
Benjamin Sago
fae0f3874e Create info module with business logic routines
Currently these routines number two: file type checking based on a file's name, and source file checking, also based on the file's name.
2016-04-16 22:05:50 +01:00
Benjamin Sago
b83844f384 Move a file's type out of its permissions field 2016-04-16 20:01:45 +01:00
Benjamin Sago
570fac0c18 Add comments to the new fields module 2016-04-16 19:56:44 +01:00
Benjamin Sago
efa372cb3b Source file rearrangements
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'.
2016-04-16 18:59:25 +01:00