diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2017-04-15 19:44:09 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2017-04-15 19:44:09 -0400 |
commit | 78d52a7c0e1eef84a61bdb847d6aa83b6dcdccb2 (patch) | |
tree | dd3060c6eed2c593160f87612b52a5ce19dd9a9c /bfs.h | |
parent | 5212c26ae12f01ec5fd66f8a3fcb41fb03c43e98 (diff) | |
download | bfs-78d52a7c0e1eef84a61bdb847d6aa83b6dcdccb2.tar.xz |
Implement -exec/-execdir ... +
Diffstat (limited to 'bfs.h')
-rw-r--r-- | bfs.h | 19 |
1 files changed, 4 insertions, 15 deletions
@@ -13,6 +13,7 @@ #define BFS_H #include "color.h" +#include "exec.h" #include "printf.h" #include <regex.h> #include <stdbool.h> @@ -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; |