summaryrefslogtreecommitdiffstats
path: root/parse.c
Commit message (Collapse)AuthorAgeFilesLines
* Make -mount and -xdev documentation alphabeticalTavian Barnes2019-07-051-3/+3
|
* Make -mount and -xdev do different thingsTavian Barnes2019-07-041-13/+38
| | | | | | | | | POSIX now says -mount should skip the whole mount point, while -xdev should only skip its descendents. C.f. http://austingroupbugs.net/view.php?id=1133 C.f. https://savannah.gnu.org/bugs/?42318 C.f. https://savannah.gnu.org/bugs/?54745
* parse: Add costs for -*able testsTavian Barnes2019-06-271-2/+18
|
* parse: Reorder table_entry to avoid needing to specify prefix=falseTavian Barnes2019-06-251-101/+101
|
* parse: Sort the parse tableTavian Barnes2019-06-161-6/+6
|
* parse: Reject unknown search strategiesTavian Barnes2019-06-041-1/+17
|
* parse: Use -S {bfs,dfs,ids} rather than -{bfs,dfs,ids}Tavian Barnes2019-06-041-14/+29
|
* Add documentation for -bfs/-dfs/-idsTavian Barnes2019-06-031-1/+5
|
* parse: Pipe bfs -help to a pager when interactiveTavian Barnes2019-05-311-3/+125
|
* parse: Fix some line wrappingTavian Barnes2019-05-311-2/+2
|
* Implement an iterative deepening mode (-ids)Tavian Barnes2019-05-291-1/+5
|
* Implement a depth-first mode (-dfs)Tavian Barnes2019-05-281-0/+26
|
* bftw: Visit multiple roots breadth-firstTavian Barnes2019-05-281-24/+18
| | | | This makes `bfs a b` treat `a` and `b` as siblings.
* Add documentation for -xattrTavian Barnes2019-05-241-4/+8
|
* Implement -xattr predicateTavian Barnes2019-05-241-0/+18
|
* fsade: Refactor the POSIX.1e abstractionsTavian Barnes2019-05-241-7/+5
| | | | | | | Since we're going to want to abstract more things that aren't part of POSIX.1e (like xattrs) in a similar way, let's give this a more generic name. And while we're at it, give it some more precise error reporting, and add some tests.
* stat: Get rid of bfs_fstat()Tavian Barnes2019-05-041-1/+1
| | | | We can just use bfs_stat() with a NULL at_path.
* stat: Unify the flags argumentsTavian Barnes2019-05-041-2/+2
|
* Add support for the NO_COLOR environment variableTavian Barnes2019-04-271-4/+10
| | | | C.f. https://no-color.org/
* parse: Add some missing costs/probabilitiesTavian Barnes2019-04-241-0/+4
| | | | Previously we weren't re-ordering -type in front of -newerXY
* parse: Allow things like -uid ++10Tavian Barnes2019-04-211-3/+9
| | | | GNU find does too.
* trie: Make trie_remove() take a leaf instead of a keyTavian Barnes2019-04-201-2/+2
|
* trie: Store void* values rather than const void*Tavian Barnes2019-03-271-2/+2
| | | | Fewer casts needed this way.
* bftw: Work around d_type being wrong for bind mounts on LinuxTavian Barnes2019-03-061-5/+8
| | | | | | 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
* parse: Use a trie to hold currently open filesTavian Barnes2019-03-061-21/+18
|
* Implement -uniqueTavian Barnes2019-03-011-3/+23
| | | | Closes #48
* parse: Wrap -help output at 80 charsTavian Barnes2019-02-131-3/+4
|
* Fix missing color escape ($) in the -help outputTavian Barnes2019-02-121-1/+1
|
* Add some documentation commentsTavian Barnes2019-02-091-0/+7
|
* Re-write the help/manpageTavian Barnes2019-02-061-164/+125
| | | | | | 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).
* parse: Treat -d as a flag, not an optionTavian Barnes2019-02-061-2/+2
| | | | | | 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.
* parse: Add support for whiteouts in -type/-xtypeTavian Barnes2019-02-061-0/+4
| | | | FreeBSD find supports this.
* Fix -nouser/-nogroup error handlingTavian Barnes2019-02-061-0/+2
| | | | | | | | | | 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.
* parse: Remove the recommendation to check find -help or man findTavian Barnes2019-02-011-6/+3
| | | | bfs has had a comprehensive help text and man page for a while now.
* parse: Allow multiple comma-separated debug flagsTavian Barnes2019-01-111-46/+81
|
* posix1e: Don't #include <sys/capability.h> on FreeBSDTavian Barnes2019-01-031-0/+1
| | | | | | | | 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.
* color: Check format strings + args for cfprintf()Tavian Barnes2019-01-021-219/+221
| | | | | | %{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.
* diag: Unify diagnostic formattingTavian Barnes2019-01-021-67/+70
| | | | | | 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.
* Hide unsupported options from -helpTavian Barnes2018-12-301-0/+6
|
* parse: Handle argc == 0Tavian Barnes2018-12-281-0/+6
| | | | | Linux allows you to exec() with no argument list at all. Default to "bfs" in that case.
* stat: Provide a helper for getting human-readable field namesTavian Barnes2018-12-251-37/+30
| | | | And fix -newerXY if the Y time doesn't exist.
* parse: Fix probabilities when -types are duplicatedTavian Barnes2018-12-191-16/+24
| | | | -type f,f does not have more than a 100% probability of success.
* parse: Add cost info for -acl and -capableTavian Barnes2018-12-191-2/+6
| | | | And set ephemeral_fds correctly too.
* Implement -acl testTavian Barnes2018-12-171-0/+19
|
* Add new -capable testTavian Barnes2018-12-171-0/+20
|
* parse: Use a better reference point for incomplete expression errorsTavian Barnes2018-11-021-1/+8
| | | | | This makes `bfs -not type d` complain about nothing following the `-not` rather than the `d`.
* parse: Add support for -D all to enable all debug flagsTavian Barnes2018-11-021-0/+3
|
* parse: Improve -D diagnosticsTavian Barnes2018-11-021-12/+26
|
* Update copyright datesTavian Barnes2018-09-241-1/+1
|
* Add some missing fallthrough commentsTavian Barnes2018-08-161-0/+1
|