summaryrefslogtreecommitdiffstats
path: root/parse.c
Commit message (Collapse)AuthorAgeFilesLines
* parse: More -help pager improvementsTavian Barnes2021-06-131-39/+24
| | | | | | | | | | If $PAGER is unset, we now try less if it exists, then fall back to more. Colors are only used if less is the used pager, since more on non-coreutils platforms doesn't always handle colors. Finally, less's configuration is given on the command line, which works better if the user has $LESS already set. Fixes https://github.com/tavianator/bfs/issues/76.
* util: Rename fallthrough to BFS_FALLTHROUGHTavian Barnes2021-06-091-9/+9
| | | | This avoids shadowing the actually standard name fallthrough.
* Implement time units for -{a,B,c,m}timeTavian Barnes2021-06-021-11/+84
| | | | From FreeBSD find. Closes #75.
* Enable -Wimplicit-fallthroughTavian Barnes2021-06-021-5/+5
|
* parse: launch_pager(): set the LESS environment variable if it is empty.Markus F.X.J. Oberhumer2021-04-141-7/+12
|
* parse: check if PAGER environment variable is empty.Markus F.X.J. Oberhumer2021-04-131-1/+1
|
* Support -flags on all the BSDsTavian Barnes2021-03-061-26/+9
|
* Implement -flags, from FreeBSD findTavian Barnes2021-03-061-0/+55
| | | | This is the last BSD-specific primary I'm aware of. Fixes #14.
* Update copyright datesTavian Barnes2021-02-051-1/+1
|
* dir: New DIR* facadeTavian Barnes2021-01-281-10/+11
|
* parse: Fix the token type of -nowarnTavian Barnes2021-01-241-1/+1
|
* -perm: Use +t instead of ug+tTavian Barnes2021-01-131-2/+4
| | | | | | | | | The chmod spec says that ug+t is unspecified, and only +t or a+t is guaranteed to actually set the sticky bit. In practice GNU tools respect o+t as well, but ignore u+t/g+t. Fix the implementation to match GNU, and only test the POSIX required parse.
* Give messages to unconditional assertion failuresTavian Barnes2020-12-021-1/+1
|
* parse: Clean up debug flag parsing/printingTavian Barnes2020-12-021-37/+22
|
* parse: Don't pass an uninitialized regex_t to regerror()Tavian Barnes2020-11-281-1/+1
|
* Include what I useTavian Barnes2020-11-121-4/+3
| | | | Thanks to https://github.com/include-what-you-use/include-what-you-use
* New -status option to display a status barTavian Barnes2020-11-031-3/+16
|
* exec: Adjust some calling conventionsTavian Barnes2020-10-061-3/+3
|
* printf: Adjust some calling conventionsTavian Barnes2020-10-061-3/+3
|
* diag: New bfs_perror() functionTavian Barnes2020-10-051-16/+23
|
* parse: Fail if -color is passed and the colors couldn't be parsedTavian Barnes2020-10-041-0/+10
|
* parse: More accurate error reporting for cfdup()Tavian Barnes2020-10-041-1/+7
|
* parse: Report errors when failing to add a rootTavian Barnes2020-10-041-1/+5
|
* Rename struct cmdline to bfs_ctxTavian Barnes2020-09-271-310/+172
| | | | | The API remains similar, with some added accessor functions for lazy initialization of the pwcache and mtab.
* stat: Rename bfs_stat_flag to _flagsTavian Barnes2020-09-181-1/+1
| | | | Flags enums should be plural.
* Implement -xattrnameTavian Barnes2020-08-131-0/+20
| | | | From macOS find.
* bftw: Make some flag names more explicitTavian Barnes2020-07-291-15/+15
|
* bftw: Rename bftw_typeflag to bftw_type, and make it not a bitmaskTavian Barnes2020-07-291-4/+5
|
* Implement exponential deepening searchTavian Barnes2020-06-161-3/+10
|
* parse: Color the optimization level differently in dump_cmdline()Tavian Barnes2020-06-071-1/+1
|
* opt: Dump the command line before optimizing with -D optTavian Barnes2020-06-071-2/+2
|
* parse: Prohibit actions inside -excludeTavian Barnes2020-06-071-1/+19
|
* Treat -nohidden like -exclude -hiddenTavian Barnes2020-06-071-7/+21
| | | | Fixes #30.
* Implement -exclude, a special form for convenient exclusionsTavian Barnes2020-06-071-0/+31
| | | | Fixes #8.
* diag: Unify debug printingTavian Barnes2020-06-021-53/+18
|
* opt: Track data flow information about predicatesTavian Barnes2020-05-221-2/+2
| | | | | | | | | | This allows us to optimize things like -sparse -o -not -sparse <==> -true and -sparse -a -not -sparse <==> -false
* pwcache: Rename from passwd.[ch]Tavian Barnes2020-04-221-1/+1
|
* parse: Use the right color when suggesting typo fixesTavian Barnes2020-03-211-113/+126
|
* parse: Add -X and -s to -D tree outputTavian Barnes2020-03-211-17/+26
|
* Implement -s flag from FreeBSD find to sort resultsTavian Barnes2020-03-211-0/+11
|
* parse: Fix color code with -D tree -xdevTavian Barnes2020-03-201-1/+1
|
* parse: Prettify some errors and warningsTavian Barnes2020-03-201-51/+57
|
* parse: Prettify some of the option-specific helpTavian Barnes2020-03-201-41/+32
|
* parse: Don't warn if POSIXLY_CORRECT is setTavian Barnes2020-03-151-2/+4
|
* diag: Make the -warn flag part of the cmdlineTavian Barnes2020-03-151-30/+23
|
* passwd: Cache the user/group tablesTavian Barnes2020-02-291-6/+44
| | | | | | | | | | | | | | | | | | | | | | This is a significant optimization for conditions that need these tables: Benchmark #1: ./bfs ~/code/linux -nouser >/dev/null Time (mean ± σ): 232.0 ms ± 2.5 ms [User: 44.3 ms, System: 185.0 ms] Range (min … max): 228.7 ms … 238.7 ms 12 runs Benchmark #2: ./bfs-1.6 ~/code/linux -nouser >/dev/null Time (mean ± σ): 1.050 s ± 0.012 s [User: 544.2 ms, System: 500.0 ms] Range (min … max): 1.025 s … 1.063 s 10 runs Benchmark #3: find ~/code/linux -nouser >/dev/null Time (mean ± σ): 1.040 s ± 0.012 s [User: 533.6 ms, System: 500.6 ms] Range (min … max): 1.017 s … 1.054 s 10 runs Summary './bfs ~/code/linux -nouser >/dev/null' ran 4.48 ± 0.07 times faster than 'find ~/code/linux -nouser >/dev/null' 4.52 ± 0.07 times faster than './bfs-1.6 ~/code/linux -nouser >/dev/null'
* parse: Give -ls and -fls an ephemeral FD for getpwuid()/getgrgid()Tavian Barnes2020-02-291-0/+2
| | | | | | Similar to 9009456c, those functions may open /etc/{passwd,group}, so they need an FD available. Right now, -ls on large trees eventually starts printing numeric IDs instead of usernames/group names.
* parse: Don't return success for invalid parse_int() calls with -DNDEBUGTavian Barnes2020-02-251-2/+2
|
* time: Split out time-related functions from utilTavian Barnes2020-02-131-145/+14
|
* parse: Handle 1969-12-31T23:59:59ZTavian Barnes2020-02-131-13/+14
| | | | | mktime() returns -1 on error, but also for one second before the epoch. Compare the input against localtime(-1) to distinguish those cases.