Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ Options:
-t, --type <filetype> Filter by type: file (f), directory (d/dir), symlink (l),
executable (x), empty (e), socket (s), pipe (p), char-device
(c), block-device (b)
-e, --extension <ext> Filter by file extension
-e, --extension <ext> Filter by extension (applies to all entry types)
-S, --size <size> Limit results based on the size of files
--changed-within <date|dur> Filter by file modification time (newer than)
--changed-before <date|dur> Filter by file modification time (older than)
Expand Down
6 changes: 4 additions & 2 deletions doc/fd.1
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,11 @@ Examples:
.RE
.TP
.BI "\-e, \-\-extension " ext
Filter search results by file extension
Filter search results by extension
.IR ext .
This option can be used repeatedly to allow for multiple possible file extensions.
This applies to all entry types, not just files. Use \fB\-\-type\fR to restrict
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On linux at least, a directory is a file.

the search to specific types.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
the search to specific types.
the search to specific types.

maybe?

This option can be used repeatedly to allow for multiple possible extensions.

If you want to search for files without extension, you can use the regex '^[^.]+$'
as a normal search pattern.
Expand Down
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ pub struct Opts {
long = "extension",
short = 'e',
value_name = "ext",
help = "Filter by file extension",
help = "Filter by extension (applies to all entry types)",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is necessary in the short help (output with -h).

I think mentioning this would be fine in the long help (output with --help), which comes from the doc comment above this.

long_help
)]
pub extensions: Option<Vec<String>>,
Expand Down