Commit Graph

591 Commits

Author SHA1 Message Date
Mattias Andrée
a77230a6e8 Proper install support
Use quotes to support spaces and such.
   Use -- to support dashes.

   And most important:

     Use DESTDIR to support installing into a staging directory.
     This is useful for packaging and verifying the install.

Signed-off-by: Mattias Andrée <maandree@kth.se>
2016-07-04 13:18:13 +02:00
Benjamin Sago
6522337463 Merge pull request #114 from Lindenk/unix_types
Exa now recognizes pipes, devices, and sockets on unix systems
2016-07-02 14:52:58 +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
Ben S
580ad0cfec Stop Travis from getting hung up on read 2016-06-11 14:12:38 +01:00
Ben S
921f3ca37c Make xattr tests optional for Travis 2016-06-11 14:06:43 +01:00
Ben S
5f01ff02fa Split tests into one file per test directory 2016-06-11 13:57:33 +01:00
Ben S
331d5ea724 Rename underscored lifetimes
See https://github.com/rust-lang/rfcs/pull/1177
2016-06-11 13:35:40 +01:00
Benjamin Sago
50c0c36b6b Update homepage link 2016-05-24 09:03:16 +01:00
Benjamin Sago
069908adb6 Merge pull request #111 from hoodie/master
Fix building without default features
2016-05-24 09:01:26 +01:00
Hendrik Sollich
c2d42e7d84 Fix building without default features 2016-05-03 00:03:22 +02:00
Benjamin Sago
299289d76f Fix the Travis build
The tests, as I so clearly wrote a comment to indicate, can only be run after the script to generate the testcases has been run...
2016-04-26 17:54:23 +01:00
Benjamin Sago
110a1c716b Convert exa into a library
This commit removes the 'main' function present in main.rs, renames it to exa.rs, and puts the 'main' function in its own binary. This, I think, makes it more clear how the program works and where the main entry point is.

Librarification also means that we can start testing as a whole. Two tests have been added that test everything, passing in raw command-line arguments then comparing against the binary coloured text that gets produced.

Casualties include having to specifically mark some code blocks in documentation as 'tests', as rustdoc kept on trying to execute my ANSI art.
2016-04-19 07:48:41 +01:00
Benjamin Sago
a02f37cb45 Change views to print to a Writer, not stdout
This will mean that we can test exa's output as a whole, without having to rely on process or IO or anything like that.
2016-04-18 18:39:32 +01:00
Benjamin Sago
476406f43b Remove unused argument 2016-04-17 21:01:30 +01:00
Benjamin Sago
78ff651326 Remove unnecessary .to_string()s from option tests 2016-04-17 20:56:06 +01:00
Benjamin Sago
e9e1161cec Split up the options module
The original options was becoming a bit unwieldy, and would have been even more so if I added the same amount of comments. So this commit splits it up.

There's no extra hiding going on here, or rearranging things within the module: (almost) everything now has to be marked 'pub' to let other sub-modules in the new options module to see it.
2016-04-17 20:38:37 +01:00
Benjamin Sago
b44ae1b56b Remove pointless OptionSet trait
The trait was only used internally to the options module, so it doesn't actually need to be exist or implemented on anything! We can just impl them directly on the types and have those methods be local to the module.
2016-04-16 22:25:24 +01:00
Benjamin Sago
45c93b1b63 Correct the list of crypto extensions
They were the same as the archive/compressed extensions, and I never noticed!
2016-04-16 22:17:12 +01: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
Benjamin Sago
b65043d6d9 Update raw libc types for Rust 1.8.0
Fixes #108. MetadataExt now returns direct numeric types rather than platform-specific ones, so we need to adjust the functions that use these to have the new types. I've just aliased the types to specific ones so the rest of the code remains the same (file.rs is the only place that uses this)

The RFC that changed this is here: https://github.com/rust-lang/rust/pull/31551
2016-04-16 17:06:26 +01:00
Benjamin Sago
9b87ef1da2 Print the parent path for passed-in files
This commit changes all the views to accommodate printing each path's prefix, if it has one.

Previously, each file was stripped of its ancestry, leaving only its file name to be displayed. So running "exa /usr/bin/*" would display only filenames, while running "ls /usr/bin/*" would display each file prefixed with "/usr/bin/". But running "ls /usr/bin/" -- without the glob -- would run ls on just the directory, printing out the file names with no prefix or anything.

This functionality turned out to be useful in quite a few situations: firstly, if the user passes in files from different directories, it would be hard to tell where they came from (especially if they have the same name, such as find | xargs). Secondly, this also applied when following symlinks, making it unclear exactly which file a symlink would be pointing to.

The reason that it did it this way beforehand was that I didn't think of these use-cases, rather than for any technical reason; this new method should not have any drawbacks save making the output slightly wider in a few cases. Compatibility with ls is also a big plus.

Fixes #104, and relates to #88 and #92.
2016-04-11 19:10:55 +01:00
Benjamin Sago
f35d28d1b8 Fix bug where the directory name was not printed 2016-04-11 07:48:23 +01:00
Benjamin Sago
c009a68ae5 Add Add impl and various tests for DisplayWidth 2016-04-05 18:45:35 +01:00
Ben S
f6c5c89f55 Always sort files the same way
This fixes a bug where extra sorting options (dirs first, reverse) were not applied when listing in long mode. In other words, fixes #105.

The bug occurred because the sorting function only took Files, but the details view uses File eggs that only contain Files. This commit changes the sorting function to accept anything that AsRefs to File, and impls that on both File and Egg so the same function works for both.
2016-03-31 23:13:15 +01:00
Ben S
eaa799c647 Replace deprecated raw types with libc ones
This limits it to stable until the APIs stabilise (weird, huh?)
2016-03-31 21:42:53 +01:00
Ben S
ee4c09dd30 Use only the time zone data present on the system
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.
2016-03-31 21:19:29 +01:00
Ben S
1dd9e6153b Versions bumps 2016-03-31 20:48:44 +01:00
Ben S
8805ce9e3b Add case-insensitive extension sorting
This finishes off and closes #102. The code in this and the previous commit
were partly authored by `zv0n` on GitHub.
2016-03-19 15:06:26 +00:00
Benjamin Sago
3e9616cffa Add --sort=Name case-insensitive sorting
This uses the case-insensitive sort function in the `natord` crate to
convert both strings to lowercase lazily, sorting them as it goes. It
also adds tests for `--sort` in general.

The case sensitivity has been made an enum so it can be reused for other
fields (say, the file extension).

See #102.
2016-03-18 10:20:44 -04:00
Benjamin Sago
d3846468a3 Fix my own broken changes
- Fix visibility errors I stupidly didn't test before committing earlier
  today
- Silence warnings about casting that were necessary for ARM
- Update dependencies
2016-03-18 08:19:51 -04:00
Ben S
8ef316e1a4 Remove unnecessary FileTypes trait 2016-03-17 20:40:04 +00:00
Benjamin Sago
46593d3c2e Merge pull request #103 from petevine/master
Update Cargo dependencies
2016-03-17 20:26:37 +00:00
petevine
f8290dfe10 Update Cargo dependencies 2016-03-13 16:12:33 +01:00
Ben S
252eba4844 Improve error when we can't find a time zone 2016-02-11 15:52:40 +00:00
Ben S
767d9fc283 Finally upgrade to a working zoneinfo_compiled
Travis didn't like the old versions.
2016-02-10 21:33:25 +00:00
Ben S
16fa37867d Versions bump (temporary, ignore this) 2016-02-10 20:28:24 +00:00
Ben S
2e8de3fb71 Fix import of TZResult 2016-02-10 19:11:10 +00:00
Ben S
7f480ab06b Improve system time zone detection 2016-02-10 19:02:20 +00:00
Ben S
8cadfa0049 Have Travis run some sample builds 2016-02-10 18:33:05 +00:00
Ben S
1e33f9c055 Correct Nightly errors in Makefile 2016-02-10 18:21:49 +00:00
Ben S
b3d252522a Update test timezone to one we know exists
It wasn't the Arc unwrap causing the crash on Linux. Maybe it's this.
2016-02-10 16:16:09 +00:00
Ben S
2b213b3aea Rewrite tests to not use unwrap
Something about these seemed to be causing a crash on Travis (build 327)... I have no idea what would set it off, but this makes the code better anyway.
2016-02-10 16:08:15 +00:00
Ben S
75b2748ab1 Update packages to latest versions
- 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
2016-02-10 15:22:43 +00:00
Ben S
e1d2c3f46e Merge branch 'split-up-details' 2016-01-26 17:14:12 +00:00
Ben S
1f9b002d52 Versions bump 2016-01-22 02:11:34 +00:00
Benjamin Sago
4c3266310d Fix bug where xattr '@' characters weren't shown
The `--long` flag should show the '@' character in the permissions list if that feature has been compiled in, but only the `--extended` flag should actually show their keys, rather than just their presence.
2016-01-16 12:19:00 -10:00