summaryrefslogtreecommitdiffstats
path: root/src/ctx.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-07-02 16:16:32 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-08-12 16:18:31 -0400
commit1234d764ba3059eb2314cb50a2790240ed7ac630 (patch)
tree792bc5659fcaf0ad2a327393c15b09f5cb8ee458 /src/ctx.h
parent11e309670b83e997d1dc2569faf002647f70a73b (diff)
downloadbfs-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.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ctx.h b/src/ctx.h
index 064e8b0..c7ebc20 100644
--- a/src/ctx.h
+++ b/src/ctx.h
@@ -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. */