Merge pull request #1464 from Ato2207/dir_alias

Added alias --type dir
This commit is contained in:
Thayne McCombs 2024-01-07 12:03:24 -07:00 committed by GitHub
commit 14ed023875
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 7 deletions

View file

@ -2,6 +2,7 @@
## Features
- Add `dir` as an alias to `directory` when using `-t` \ `--type`, see #1460 and #1464 (@Ato2207).
## Bugfixes

View file

@ -316,9 +316,9 @@ Options:
-p, --full-path Search full abs. path (default: filename only)
-d, --max-depth <depth> Set maximum search depth (default: none)
-E, --exclude <pattern> Exclude entries that match the given glob pattern
-t, --type <filetype> Filter by type: file (f), directory (d), symlink (l),
executable (x), empty (e), socket (s), pipe (p), char-device
(c), block-device (b)
-t, --type <filetype> Filter by type: file (f), directory (d/dir), symlink (l),
executable (x), empty (e), socket (s), pipe (p),
block-device (b), char-device (c)
-e, --extension <ext> Filter by file extension
-S, --size <size> Limit results based on the size of files
--changed-within <date|dur> Filter by file modification time (newer than)

2
doc/fd.1 vendored
View file

@ -191,7 +191,7 @@ Filter search by type:
.RS
.IP "f, file"
regular files
.IP "d, directory"
.IP "d, dir, directory"
directories
.IP "l, symlink"
symbolic links

View file

@ -314,7 +314,7 @@ pub struct Opts {
/// Filter the search by type:
/// {n} 'f' or 'file': regular files
/// {n} 'd' or 'directory': directories
/// {n} 'd' or 'dir' or 'directory': directories
/// {n} 'l' or 'symlink': symbolic links
/// {n} 's' or 'socket': socket
/// {n} 'p' or 'pipe': named pipe (FIFO)
@ -352,7 +352,7 @@ pub struct Opts {
value_name = "filetype",
hide_possible_values = true,
value_enum,
help = "Filter by type: file (f), directory (d), symlink (l), \
help = "Filter by type: file (f), directory (d/dir), symlink (l), \
executable (x), empty (e), socket (s), pipe (p), \
char-device (c), block-device (b)",
long_help
@ -729,7 +729,7 @@ fn default_num_threads() -> NonZeroUsize {
pub enum FileType {
#[value(alias = "f")]
File,
#[value(alias = "d")]
#[value(alias = "d", alias = "dir")]
Directory,
#[value(alias = "l")]
Symlink,