summaryrefslogtreecommitdiffstats
path: root/bfs.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-04-15 19:44:09 -0400
committerTavian Barnes <tavianator@tavianator.com>2017-04-15 19:44:09 -0400
commit78d52a7c0e1eef84a61bdb847d6aa83b6dcdccb2 (patch)
treedd3060c6eed2c593160f87612b52a5ce19dd9a9c /bfs.h
parent5212c26ae12f01ec5fd66f8a3fcb41fb03c43e98 (diff)
downloadbfs-78d52a7c0e1eef84a61bdb847d6aa83b6dcdccb2.tar.xz
Implement -exec/-execdir ... +
Diffstat (limited to 'bfs.h')
-rw-r--r--bfs.h19
1 files changed, 4 insertions, 15 deletions
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 <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;