summaryrefslogtreecommitdiffstats
path: root/parse.c
AgeCommit message (Collapse)Author
2019-05-04stat: Get rid of bfs_fstat()Tavian Barnes
We can just use bfs_stat() with a NULL at_path.
2019-05-04stat: Unify the flags argumentsTavian Barnes
2019-04-27Add support for the NO_COLOR environment variableTavian Barnes
C.f. https://no-color.org/
2019-04-24parse: Add some missing costs/probabilitiesTavian Barnes
Previously we weren't re-ordering -type in front of -newerXY
2019-04-21parse: Allow things like -uid ++10Tavian Barnes
GNU find does too.
2019-04-20trie: Make trie_remove() take a leaf instead of a keyTavian Barnes
2019-03-27trie: Store void* values rather than const void*Tavian Barnes
Fewer casts needed this way.
2019-03-06bftw: Work around d_type being wrong for bind mounts on LinuxTavian Barnes
C.f. https://savannah.gnu.org/bugs/?54913 C.f. https://lkml.org/lkml/2019/2/11/2027 Fixes https://github.com/tavianator/bfs/issues/37
2019-03-06parse: Use a trie to hold currently open filesTavian Barnes
2019-03-01Implement -uniqueTavian Barnes
Closes #48
2019-02-13parse: Wrap -help output at 80 charsTavian Barnes
2019-02-12Fix missing color escape ($) in the -help outputTavian Barnes
2019-02-09Add some documentation commentsTavian Barnes
2019-02-06Re-write the help/manpageTavian Barnes
I'm not sure people care very much whether the functionality they're looking up originated in POSIX/BSD/GNU find (and if they do, they can check those docs).
2019-02-06parse: Treat -d as a flag, not an optionTavian Barnes
This is consistent with BSD find, not with GNU find. But the GNU find feature was an (incorrect) attempt to be compatible with BSD find anyway.
2019-02-06parse: Add support for whiteouts in -type/-xtypeTavian Barnes
FreeBSD find supports this.
2019-02-06Fix -nouser/-nogroup error handlingTavian Barnes
The proper way to check for nonexistent users/groups is to set errno to 0 before the get{grg,pwu}id() call, and check it afterwards. On doing this, it becomes obvious that the call can fail if bftw() is using all the available FDs, so give them some ephemeral FDs. It would be ideal to read the user/group table only once, but this fixes the bug for now.
2019-02-01parse: Remove the recommendation to check find -help or man findTavian Barnes
bfs has had a comprehensive help text and man page for a while now.
2019-01-11parse: Allow multiple comma-separated debug flagsTavian Barnes
2019-01-03posix1e: Don't #include <sys/capability.h> on FreeBSDTavian Barnes
The file is there by default, but deprecated and not a POSIX.1E implementation. While I'm at it, move the logic to posix1e.h so other files aren't burdened with an extra include. Fixes the other half of #40.
2019-01-02color: Check format strings + args for cfprintf()Tavian Barnes
%{cc} is now ${cc} to avoid warnings about an unrecognized format specifier, and %P and %L are now %pP and %pL to make them look more like standard format strings.
2019-01-02diag: Unify diagnostic formattingTavian Barnes
This adds a bfs: prefix to error/warning messages for consistency with other command line tools, and leaves only the "error:"/"warning:" part colored like GCC. It also uniformly adds full stops after messages.
2018-12-30Hide unsupported options from -helpTavian Barnes
2018-12-28parse: Handle argc == 0Tavian Barnes
Linux allows you to exec() with no argument list at all. Default to "bfs" in that case.
2018-12-25stat: Provide a helper for getting human-readable field namesTavian Barnes
And fix -newerXY if the Y time doesn't exist.
2018-12-19parse: Fix probabilities when -types are duplicatedTavian Barnes
-type f,f does not have more than a 100% probability of success.
2018-12-19parse: Add cost info for -acl and -capableTavian Barnes
And set ephemeral_fds correctly too.
2018-12-17Implement -acl testTavian Barnes
2018-12-17Add new -capable testTavian Barnes
2018-11-02parse: Use a better reference point for incomplete expression errorsTavian Barnes
This makes `bfs -not type d` complain about nothing following the `-not` rather than the `d`.
2018-11-02parse: Add support for -D all to enable all debug flagsTavian Barnes
2018-11-02parse: Improve -D diagnosticsTavian Barnes
2018-09-24Update copyright datesTavian Barnes
2018-08-16Add some missing fallthrough commentsTavian Barnes
2018-07-06parse: Add some missing failure messagesTavian Barnes
2018-06-18parse: Don't leave expr->mode_cmp uninitializedTavian Barnes
When adding support for -perm +7777, I introduced an unconditional break that should have been conditional. The bug was observable with $ ./tests.sh --verbose --bfs="valgrind $PWD/bfs" test_perm_leading_plus_symbolic Fixes: 7f8bacca4c2b1d35bb65ddf8cbf70fadf1adf66e
2018-01-20printf: Add %w and %Wk for file birth timesTavian Barnes
%w and %W were chosen to match the format specifiers for file birth times from stat(1)
2018-01-08stat: New wrapper around the stat() familyTavian Barnes
This lets bfs transparently support the new statx() system call on Linux, giving it access to file birth times.
2018-01-06parse: Minor cleanups from af7878c/7da0d28Tavian Barnes
2017-12-15Keep track of required FDs per-exprTavian Barnes
2017-11-13color: Implement %m for cfprintf()Tavian Barnes
2017-11-12exec: Recover from E2BIGTavian Barnes
2017-11-12cmdline: Account for files opened during/between evaluations more carefullyTavian Barnes
2017-11-05Add support for file birth/creation times on platforms that have itTavian Barnes
Fixes #19
2017-11-05parse: Support -perm +7777, for compatibility with BSD and old GNU findTavian Barnes
2017-10-21parse: Keep track of what files are already openTavian Barnes
Fixes #22
2017-10-21Report errors that occur when closing filesTavian Barnes
Otherwise we miss write errors that occur when flushing the cache.
2017-10-15Add a man pageTavian Barnes
Fixes #31
2017-09-17parse: Document the bfs meaning of -O in -helpTavian Barnes
2017-09-16opt: Separate optimization from parsingTavian Barnes