From 78d52a7c0e1eef84a61bdb847d6aa83b6dcdccb2 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 15 Apr 2017 19:44:09 -0400 Subject: Implement -exec/-execdir ... + --- bfs.h | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'bfs.h') diff --git a/bfs.h b/bfs.h index e3f4263..53c8b1e 100644 --- a/bfs.h +++ b/bfs.h @@ -13,6 +13,7 @@ #define BFS_H #include "color.h" +#include "exec.h" #include "printf.h" #include #include @@ -179,18 +180,6 @@ enum size_unit { SIZE_PB, }; -/** - * Flags for the -exec actions. - */ -enum exec_flags { - /** Prompt the user before executing (-ok, -okdir). */ - EXEC_CONFIRM = 1 << 0, - /** Run the command in the file's parent directory (-execdir, -okdir). */ - EXEC_CHDIR = 1 << 1, - /** Pass multiple files at once to the command (-exec ... {} +). */ - EXEC_MULTI = 1 << 2, -}; - struct expr { /** The function that evaluates this expression. */ eval_fn *eval; @@ -247,12 +236,12 @@ struct expr { /** File to output to. */ CFILE *cfile; - /** Optional -exec flags. */ - enum exec_flags exec_flags; - /** Optional compiled regex. */ regex_t *regex; + /** Optional exec command. */ + struct bfs_exec *execbuf; + /** Optional printf command. */ struct bfs_printf *printf; -- cgit v1.2.3