Commit Graph

83 Commits

Author SHA1 Message Date
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
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
67f60e614b Add --version command (and bump version) 2015-03-02 14:54:38 +00:00
Ben S
ff1f6d0087 Add --group-directories-first option
Closes #27.
2015-02-26 14:05:26 +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
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
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
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
nwin
f44711cfd0 Fixed tests. 2015-02-23 08:30:58 +01: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
Steven Allen
2b5406842f Get rid of explicit as_slice() calls. 2015-02-22 12:11:33 -05:00
nwin
3d587c4533 Rename attr to xattr 2015-02-22 13:55:13 +01:00
nwin
227ddc9a0c Fix other platforms than macos. 2015-02-22 13:44:55 +01:00
nwin
48b6123165 Implement display of extended attributes 2015-02-22 13:26:52 +01:00
Ben S
a4e17193d9 Add sort-by-date options
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-22 00:40:46 +00:00
Ben S
f8768e7c01 Mandate --recurse with --tree
Fixes #7.
2015-02-21 23:43:40 +00:00
Ben S
21ac16f808 Format file size in bytes with the user's locale
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.
2015-02-10 16:08:10 +00:00
Ben S
f3c3a02e98 Make --tree require --long 2015-02-10 12:08:01 +00:00
Ben S
8b520edf3d Only display the year if it's last year
Otherwise, just display the hour and minute.
2015-02-09 18:14:05 +00:00
Ben S
1e48539380 Add shorthand options for displaying timestamps
Add options -u, -U, and -m as shorthand options for displaying different
types of timestamp, not just one. It's possible to have more than one by
specifying more than one of these shorthands, but *not* when used with
--time, as this is only meant to display one at a time.
2015-02-09 17:20:42 +00:00
Ben S
4a6555b9a9 Forbid --time without --long option, too 2015-02-09 16:55:00 +00:00
Ben S
0d7de0a2fa Add --tree to README 2015-02-09 16:49:31 +00:00
Ben S
a777794f65 Change time option's description 2015-02-09 16:36:51 +00:00
Ben S
0d25a90ef1 Initial work on date/time columns for files
Using the datetime crate, add an extra column to the --long view that
prints out the modified, accessed, or created timestamp for each file.
Also, let the user pick which one they want to see based on the --time
command-line option.
2015-02-09 16:33:27 +00:00
Ben S
055854d839 Upgrade to latest Rust
- std::os -> std::env
2015-02-05 15:25:59 +00:00
Ben S
42ae7b3d33 Refactor the code after tree view changes
- Turn the views and main program loop into structs, rather than just as one gigantic function
- Separate views into their own files

The addition of the git column and the tree view meant that a lot of functions now just took extra arguments that didn't seem to fit. For example, it didn't really work to have only one 'view' method that printed out everything, as the different view options now all take different parameters.
2015-02-05 14:39:56 +00:00
Ben S
2be30f36f2 Make transform_files stateful
Using `retain` instead of `filter` means we can just re-use the same Vec.
2015-02-04 15:47:52 +00:00
Ben S
8f36dbbc6f Start using the new getopts interface 2015-02-04 14:51:55 +00:00
Ben S
184c27f5b4 unwrap_err() now uses Debug 2015-02-04 01:40:12 +00:00
Ben S
5eb9f9e414 Have tree view obey filtering and sorting 2015-02-03 21:26:21 +00:00
Ben S
d4d04b7e92 Turn the file filter options into their own struct 2015-02-03 17:03:58 +00:00
Ben S
827a1e11fd Make filename not a column
FileName was always a special-cased column, as it was assumed to be the last column in the output. Now, it's explicitly marked as such. This allows the hash marks to be placed before the filename, rather than at the start of the line.
2015-02-03 13:48:39 +00:00
Ben S
5099b3f119 Initial tree implementation
There's still a lot to do, but this is actually *something*. The tree hierarchy is displayed using hashes at the start of a line. I want to have it just before the filename, but this will need some changes to the way that columns are handled.
2015-02-03 13:27:23 +00:00
Ben S
5611a5768a Recurse into directories 2015-02-01 02:14:31 +00:00
Ben S
3242cb216a Fix failing tests 2015-01-31 17:24:54 +00:00
Ben S
6d4b30d531 Code changes in preparation for recursion 2015-01-31 16:10:40 +00:00
Ben S
b0cdd17b97 Change the way columns are created
You can now have different columns per directory. So now, the Git column only appears when there's a Git repository in the current directory.
2015-01-28 22:02:25 +00:00
Ben S
1d0cc329eb Don't even show the column without the feature 2015-01-27 15:30:55 +00:00
Ben S
90d4684de4 Preliminary Git support!
This is something that I've long wanted to add. It uses libgit2 as an optional dependency.
2015-01-27 15:01:17 +00:00
Ben S
da9d1f77d9 Cache the lowercased extension
Extensions aren't ever displayed in lowercase, just compared case-insensitively, so this makes sense.
2015-01-26 01:16:19 +00:00
Ben S
22a4dc90b9 Update #[derive] names 2015-01-26 00:27:06 +00:00
Benjamin Sago
f82dc741de Correct argument name 2015-01-24 17:14:25 +00:00
Benjamin Sago
74fd04c1fb Forbid a few more option combinations 2015-01-24 16:03:58 +00:00