Comments (7)
From my point of view, there are fundamentally 2 different routes to take here.
Either "fd" is targeted as a system tool (like "find"), or it is targeted as an end-user utility. Think of the "plumbing/porcelain" split i git.
User tools can have config files, but system tools absolutely cannot. If this is going to be used in scripts, in automation, etc, the behavior has to be completely determined from the command line arguments.
Users can still set options via aliases, but I agree that this is less ergonomic than a config file. It's also possible to make a heuristic for determining when to use the config file (say, when the tool is run interactively), but I'm afraid this is too confusing and subtle.
So, if we discuss "fd" as a user tool, it can have all the fancy bells and whistles. Strictly personally, I would love a neater alternative to interactive uses of "find", but I absolutely need to trust that my file finder doesn't hide files from me. For example, a reasonable default could be collapse-vcs, which would turn this:
./Cargo.toml.orig
./Cargo.toml~
./.git
./.git/description
./.git/info
...[thousands of lines]...
./.git/modules/duranium/ORIG_HEAD
./.git/modules/duranium/COMMIT_EDITMSG
./.git/ORIG_HEAD
./.git/COMMIT_EDITMSG
./rustfmt.toml
./examples
./examples/foo.rs
Into this:
./Cargo.toml.orig
./Cargo.toml~
./.git [*]
./rustfmt.toml
./examples
./examples/foo.rs
Or some other syntax - but I'm not very fond of hiding files completely by default.
from fd.
Thank you for the feedback!
From my point of view, there are fundamentally 2 different routes to take here.
Either "fd" is targeted as a system tool (like "find"), or it is targeted as an end-user utility. Think of the "plumbing/porcelain" split i git.
I definitely see fd in the end-user utility corner. It is meant as a "neater alternative to interactive uses of find", as you wrote below.
User tools can have config files, but system tools absolutely cannot. If this is going to be used in scripts, in automation, etc, the behavior has to be completely determined from the command line arguments.
Users can still set options via aliases, but I agree that this is less ergonomic than a config file.
Yes, good points. Maybe, even if fd is not primarily meant as a system tool, we should try to avoid a config file at first. Aliases are not that bad and it's easy to reset them (\fd
). They also won't affect shell scripts, as you said.
It's also possible to make a heuristic for determining when to use the config file (say, when the tool is run interactively), but I'm afraid this is too confusing and subtle.
I also believe this would be confusing.
So, if we discuss "fd" as a user tool, it can have all the fancy bells and whistles. Strictly personally, I would love a neater alternative to interactive uses of "find", but I absolutely need to trust that my file finder doesn't hide files from me.
I'm not sure... I believe I have to disagree here. Hidden files are typically hidden for a good reason: because you usually do not want to care about them. ls
does not show them, by default. ag
does not search them, by default. Shell globs (*
) do not include them.
find
always searches hidden directories and files, but I believe I like the ignore-by-default option better.
For example, a reasonable default could be collapse-vcs [...]
That's a neat idea, but sometimes I might want to pipe the output of fd
to some other program (vim $(fd html)
), so this would definitely only be enabled during "interactive use".
from fd.
I've thought a bit about it, and I mostly agree. I find myself needing to be sure I see 100% of the available files quite often, so I'll keep using find
for that purpose.
I think fd
could be a nice complement to rg
, in that it has some reasonable opinions that make it easy to use out of the box. How about, in interactive mode only, a status line? Like "$x files found in $y dirs, $z ignored". Then it would be obvious if files are skipped, which is what is the important part here, imho.
It would be great if the status line could give a condensed breakdown of files found, links followed, dirs read, etc. It'd be very useful for getting the "vitals" of a search operation.
from fd.
from fd.
I have re-considered this. Adding such a status line would always mean that we have to traverse all hidden paths and all ignored paths (and their children, ..), which can lead to huge performance downsides.
I'm closing this for now, but I'm still open to suggestions.
Thank you for the feedback!
from fd.
Sorry, but I am expecting fd
to be a system utility. I get this expectation from the description "A simple, fast and user-friendly alternative to find". If you intend this tool to be used interactively only, maybe you should make it more clear.
from fd.
@ChengCat If you see a potential problem with the current situation, please feel free to open a new ticket. In my view, there is no reason not to use fd
as a system utility.
from fd.
Related Issues (20)
- [BUG] Installation failed on macOs HOT 3
- [BUG] --list-details fail on windows ( missing ls error ) while using nushell that has ls exposed
- [BUG] `--full-path` doesn't interpret with regexp `^` pattern HOT 2
- Shouldn't fd support using ~ as a subtitute for the home directory when writing paths? HOT 1
- List all directories in cwd, including '.' and '..' HOT 2
- Support timestamp in the format @%s (seconds since epoch) like GNU date HOT 1
- fdexclude/exclude configuration file, similar to fdignore/ignore configuration file HOT 2
- Adding an output mode with network-absolute paths HOT 2
- Filter files based on command output HOT 1
- [BUG] Incorrect application of `.gitignore` rules when using `fd` from a nested directory HOT 3
- [BUG] fd --glob seems wrong HOT 3
- Add clippy check to github actions CI HOT 2
- [BUG] Wrong result when --full-path and .. HOT 3
- `--all` argument HOT 2
- Ignore top level .gitignore HOT 3
- Chinese version of fd project HOT 2
- The file name containing "-- " could not be found HOT 3
- fd? fdfind? fdclone? HOT 1
- Ignore cache directories by default HOT 2
- [BUG] Redirected stdout (pipe or file) on windows has wrong encoding HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fd.