summaryrefslogtreecommitdiffstats
path: root/parse.c
AgeCommit message (Collapse)Author
2021-06-13parse: More -help pager improvementsTavian Barnes
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.
2021-06-09util: Rename fallthrough to BFS_FALLTHROUGHTavian Barnes
This avoids shadowing the actually standard name fallthrough.
2021-06-02Implement time units for -{a,B,c,m}timeTavian Barnes
From FreeBSD find. Closes #75.
2021-06-02Enable -Wimplicit-fallthroughTavian Barnes
2021-04-14parse: launch_pager(): set the LESS environment variable if it is empty.Markus F.X.J. Oberhumer
2021-04-13parse: check if PAGER environment variable is empty.Markus F.X.J. Oberhumer
2021-03-06Support -flags on all the BSDsTavian Barnes
2021-03-06Implement -flags, from FreeBSD findTavian Barnes
This is the last BSD-specific primary I'm aware of. Fixes #14.
2021-02-05Update copyright datesTavian Barnes
2021-01-28dir: New DIR* facadeTavian Barnes
2021-01-24parse: Fix the token type of -nowarnTavian Barnes
2021-01-13-perm: Use +t instead of ug+tTavian Barnes
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.
2020-12-02Give messages to unconditional assertion failuresTavian Barnes
2020-12-02parse: Clean up debug flag parsing/printingTavian Barnes
2020-11-28parse: Don't pass an uninitialized regex_t to regerror()Tavian Barnes
2020-11-12Include what I useTavian Barnes
Thanks to https://github.com/include-what-you-use/include-what-you-use
2020-11-03New -status option to display a status barTavian Barnes
2020-10-06exec: Adjust some calling conventionsTavian Barnes
2020-10-06printf: Adjust some calling conventionsTavian Barnes
2020-10-05diag: New bfs_perror() functionTavian Barnes
2020-10-04parse: Fail if -color is passed and the colors couldn't be parsedTavian Barnes
2020-10-04parse: More accurate error reporting for cfdup()Tavian Barnes
2020-10-04parse: Report errors when failing to add a rootTavian Barnes
2020-09-27Rename struct cmdline to bfs_ctxTavian Barnes
The API remains similar, with some added accessor functions for lazy initialization of the pwcache and mtab.
2020-09-18stat: Rename bfs_stat_flag to _flagsTavian Barnes
Flags enums should be plural.
2020-08-13Implement -xattrnameTavian Barnes
From macOS find.
2020-07-29bftw: Make some flag names more explicitTavian Barnes
2020-07-29bftw: Rename bftw_typeflag to bftw_type, and make it not a bitmaskTavian Barnes
2020-06-16Implement exponential deepening searchTavian Barnes
2020-06-07parse: Color the optimization level differently in dump_cmdline()Tavian Barnes
2020-06-07opt: Dump the command line before optimizing with -D optTavian Barnes
2020-06-07parse: Prohibit actions inside -excludeTavian Barnes
2020-06-07Treat -nohidden like -exclude -hiddenTavian Barnes
Fixes #30.
2020-06-07Implement -exclude, a special form for convenient exclusionsTavian Barnes
Fixes #8.
2020-06-02diag: Unify debug printingTavian Barnes
2020-05-22opt: Track data flow information about predicatesTavian Barnes
This allows us to optimize things like -sparse -o -not -sparse <==> -true and -sparse -a -not -sparse <==> -false
2020-04-22pwcache: Rename from passwd.[ch]Tavian Barnes
2020-03-21parse: Use the right color when suggesting typo fixesTavian Barnes
2020-03-21parse: Add -X and -s to -D tree outputTavian Barnes
2020-03-21Implement -s flag from FreeBSD find to sort resultsTavian Barnes
2020-03-20parse: Fix color code with -D tree -xdevTavian Barnes
2020-03-20parse: Prettify some errors and warningsTavian Barnes
2020-03-20parse: Prettify some of the option-specific helpTavian Barnes
2020-03-15parse: Don't warn if POSIXLY_CORRECT is setTavian Barnes
2020-03-15diag: Make the -warn flag part of the cmdlineTavian Barnes
2020-02-29passwd: Cache the user/group tablesTavian Barnes
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'
2020-02-29parse: Give -ls and -fls an ephemeral FD for getpwuid()/getgrgid()Tavian Barnes
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.
2020-02-25parse: Don't return success for invalid parse_int() calls with -DNDEBUGTavian Barnes
2020-02-13time: Split out time-related functions from utilTavian Barnes
2020-02-13parse: Handle 1969-12-31T23:59:59ZTavian Barnes
mktime() returns -1 on error, but also for one second before the epoch. Compare the input against localtime(-1) to distinguish those cases.