From 1bda165b25d8c0230aebaccee80b429378fc3a34 Mon Sep 17 00:00:00 2001 From: Alexandru-Constantin Atomei Date: Sat, 30 Dec 2023 22:14:53 +0200 Subject: [PATCH 1/3] Added alias --type dir --- src/cli.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli.rs b/src/cli.rs index 1b02288..926e6db 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -739,7 +739,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, From 9f096737dbb56fb00ff962a3f8ab793f404211d6 Mon Sep 17 00:00:00 2001 From: Alexandru-Constantin Atomei Date: Sat, 30 Dec 2023 22:54:57 +0200 Subject: [PATCH 2/3] Added explicit documentation about the possibility of using dir --- README.md | 2 +- src/cli.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dc16cb6..9e71d63 100644 --- a/README.md +++ b/README.md @@ -313,7 +313,7 @@ Options: -p, --full-path Search full abs. path (default: filename only) -d, --max-depth Set maximum search depth (default: none) -E, --exclude Exclude entries that match the given glob pattern - -t, --type Filter by type: file (f), directory (d), symlink (l), + -t, --type 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 Filter by file extension diff --git a/src/cli.rs b/src/cli.rs index 926e6db..c17f0b8 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -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) From 3cb6b9d93ac4a98615d6f788cc3dd72c5856cfe1 Mon Sep 17 00:00:00 2001 From: Alexandru-Constantin Atomei Date: Mon, 1 Jan 2024 17:14:32 +0200 Subject: [PATCH 3/3] Updated CHANGELOG.md, man page and made alias visible in fd -h too --- CHANGELOG.md | 1 + doc/fd.1 | 2 +- src/cli.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e852038..08f447f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Features +- Add `dir` as an alias to `directory` when using `-t` \ `--type`, see #1460 and #1464 (@Ato2207). ## Bugfixes diff --git a/doc/fd.1 b/doc/fd.1 index b9956f0..8877317 100644 --- a/doc/fd.1 +++ b/doc/fd.1 @@ -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 diff --git a/src/cli.rs b/src/cli.rs index 64ea111..6e61636 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -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