From 1234d764ba3059eb2314cb50a2790240ed7ac630 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 2 Jul 2024 16:16:32 -0400 Subject: 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 --- src/ctx.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/ctx.h') 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. */ -- cgit v1.2.3