diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-07-02 16:16:32 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-08-12 16:18:31 -0400 |
commit | 1234d764ba3059eb2314cb50a2790240ed7ac630 (patch) | |
tree | 792bc5659fcaf0ad2a327393c15b09f5cb8ee458 /src/ctx.h | |
parent | 11e309670b83e997d1dc2569faf002647f70a73b (diff) | |
download | bfs-1234d764ba3059eb2314cb50a2790240ed7ac630.tar.xz |
opt: Warn about ignored expressions after dangerous actions
For example, `bfs -delete -type f` is almost certainly a mistake.
Link: https://savannah.gnu.org/bugs/?65895
Diffstat (limited to 'src/ctx.h')
-rw-r--r-- | src/ctx.h | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -68,11 +68,16 @@ struct bfs_ctx { bool status; /** Whether to only return unique files (-unique). */ bool unique; - /** Whether to print warnings (-warn/-nowarn). */ - bool warn; /** Whether to only handle paths with xargs-safe characters (-X). */ bool xargs_safe; + /** Whether bfs was run interactively. */ + bool interactive; + /** Whether to print warnings (-warn/-nowarn). */ + bool warn; + /** Whether any dangerous actions (-delete/-exec) are present. */ + bool dangerous; + /** Color data. */ struct colors *colors; /** The error that occurred parsing the color table, if any. */ |