Skip to content

Commit

Permalink
Merge pull request #1464 from Ato2207/dir_alias
Browse files Browse the repository at this point in the history
Added alias --type dir
  • Loading branch information
tmccombs authored Jan 7, 2024
2 parents 58284b8 + 3cb6b9d commit 14ed023
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Features

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

## Bugfixes

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion doc/fd.1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 14ed023

Please sign in to comment.