summaryrefslogtreecommitdiffstats
path: root/parse.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2019-06-22 10:03:19 -0400
committerTavian Barnes <tavianator@tavianator.com>2019-06-25 01:18:47 -0400
commit8d393a4e1a37a78bccb3928379693529f78ff20e (patch)
treec66feb8a5eaf0caa925541dec57994c93768a824 /parse.c
parent03737127f63ea0f8a75305f3f06c83e715eaa1c2 (diff)
downloadbfs-8d393a4e1a37a78bccb3928379693529f78ff20e.tar.xz
parse: Reorder table_entry to avoid needing to specify prefix=false
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c202
1 files changed, 101 insertions, 101 deletions
diff --git a/parse.c b/parse.c
index 1c018be..131ab0a 100644
--- a/parse.c
+++ b/parse.c
@@ -2760,10 +2760,10 @@ typedef struct expr *parse_fn(struct parser_state *state, int arg1, int arg2);
*/
struct table_entry {
char *arg;
- bool prefix;
parse_fn *parse;
int arg1;
int arg2;
+ bool prefix;
};
/**
@@ -2771,111 +2771,111 @@ struct table_entry {
*/
static const struct table_entry parse_table[] = {
{"--"},
- {"--help", false, parse_help},
- {"--version", false, parse_version},
- {"-Bmin", false, parse_time, BFS_STAT_BTIME, MINUTES},
- {"-Bnewer", false, parse_newer, BFS_STAT_BTIME},
- {"-Btime", false, parse_time, BFS_STAT_BTIME, DAYS},
- {"-D", false, parse_debug},
- {"-E", false, parse_regex_extended},
- {"-H", false, parse_follow, BFTW_COMFOLLOW, false},
- {"-L", false, parse_follow, BFTW_LOGICAL, false},
- {"-O", true, parse_optlevel},
- {"-P", false, parse_follow, 0, false},
- {"-S", false, parse_search_strategy},
- {"-X", false, parse_xargs_safe},
+ {"--help", parse_help},
+ {"--version", parse_version},
+ {"-Bmin", parse_time, BFS_STAT_BTIME, MINUTES},
+ {"-Bnewer", parse_newer, BFS_STAT_BTIME},
+ {"-Btime", parse_time, BFS_STAT_BTIME, DAYS},
+ {"-D", parse_debug},
+ {"-E", parse_regex_extended},
+ {"-H", parse_follow, BFTW_COMFOLLOW, false},
+ {"-L", parse_follow, BFTW_LOGICAL, false},
+ {"-O", parse_optlevel, 0, 0, true},
+ {"-P", parse_follow, 0, false},
+ {"-S", parse_search_strategy},
+ {"-X", parse_xargs_safe},
{"-a"},
- {"-acl", false, parse_acl},
- {"-amin", false, parse_time, BFS_STAT_ATIME, MINUTES},
+ {"-acl", parse_acl},
+ {"-amin", parse_time, BFS_STAT_ATIME, MINUTES},
{"-and"},
- {"-anewer", false, parse_newer, BFS_STAT_ATIME},
- {"-atime", false, parse_time, BFS_STAT_ATIME, DAYS},
- {"-capable", false, parse_capable},
- {"-cmin", false, parse_time, BFS_STAT_CTIME, MINUTES},
- {"-cnewer", false, parse_newer, BFS_STAT_CTIME},
- {"-color", false, parse_color, true},
- {"-ctime", false, parse_time, BFS_STAT_CTIME, DAYS},
- {"-d", false, parse_depth},
- {"-daystart", false, parse_daystart},
- {"-delete", false, parse_delete},
- {"-depth", false, parse_depth_n},
- {"-empty", false, parse_empty},
- {"-exec", false, parse_exec, 0},
- {"-execdir", false, parse_exec, BFS_EXEC_CHDIR},
- {"-executable", false, parse_access, X_OK},
- {"-exit", false, parse_exit},
- {"-f", false, parse_f},
- {"-false", false, parse_const, false},
- {"-fls", false, parse_fls},
- {"-follow", false, parse_follow, BFTW_LOGICAL, true},
- {"-fprint", false, parse_fprint},
- {"-fprint0", false, parse_fprint0},
- {"-fprintf", false, parse_fprintf},
- {"-fstype", false, parse_fstype},
- {"-gid", false, parse_group},
- {"-group", false, parse_group},
- {"-help", false, parse_help},
- {"-hidden", false, parse_hidden},
- {"-ignore_readdir_race", false, parse_ignore_races, true},
- {"-ilname", false, parse_lname, true},
- {"-iname", false, parse_name, true},
- {"-inum", false, parse_inum},
- {"-ipath", false, parse_path, true},
- {"-iregex", false, parse_regex, REG_ICASE},
- {"-iwholename", false, parse_path, true},
- {"-links", false, parse_links},
- {"-lname", false, parse_lname, false},
- {"-ls", false, parse_ls},
- {"-maxdepth", false, parse_depth_limit, false},
- {"-mindepth", false, parse_depth_limit, true},
- {"-mmin", false, parse_time, BFS_STAT_MTIME, MINUTES},
- {"-mnewer", false, parse_newer, BFS_STAT_MTIME},
- {"-mount", false, parse_mount},
- {"-mtime", false, parse_time, BFS_STAT_MTIME, DAYS},
- {"-name", false, parse_name, false},
- {"-newer", false, parse_newer, BFS_STAT_MTIME},
- {"-newer", true, parse_newerxy},
- {"-nocolor", false, parse_color, false},
- {"-nogroup", false, parse_nogroup},
- {"-nohidden", false, parse_nohidden},
- {"-noignore_readdir_race", false, parse_ignore_races, false},
- {"-noleaf", false, parse_noleaf},
+ {"-anewer", parse_newer, BFS_STAT_ATIME},
+ {"-atime", parse_time, BFS_STAT_ATIME, DAYS},
+ {"-capable", parse_capable},
+ {"-cmin", parse_time, BFS_STAT_CTIME, MINUTES},
+ {"-cnewer", parse_newer, BFS_STAT_CTIME},
+ {"-color", parse_color, true},
+ {"-ctime", parse_time, BFS_STAT_CTIME, DAYS},
+ {"-d", parse_depth},
+ {"-daystart", parse_daystart},
+ {"-delete", parse_delete},
+ {"-depth", parse_depth_n},
+ {"-empty", parse_empty},
+ {"-exec", parse_exec, 0},
+ {"-execdir", parse_exec, BFS_EXEC_CHDIR},
+ {"-executable", parse_access, X_OK},
+ {"-exit", parse_exit},
+ {"-f", parse_f},
+ {"-false", parse_const, false},
+ {"-fls", parse_fls},
+ {"-follow", parse_follow, BFTW_LOGICAL, true},
+ {"-fprint", parse_fprint},
+ {"-fprint0", parse_fprint0},
+ {"-fprintf", parse_fprintf},
+ {"-fstype", parse_fstype},
+ {"-gid", parse_group},
+ {"-group", parse_group},
+ {"-help", parse_help},
+ {"-hidden", parse_hidden},
+ {"-ignore_readdir_race", parse_ignore_races, true},
+ {"-ilname", parse_lname, true},
+ {"-iname", parse_name, true},
+ {"-inum", parse_inum},
+ {"-ipath", parse_path, true},
+ {"-iregex", parse_regex, REG_ICASE},
+ {"-iwholename", parse_path, true},
+ {"-links", parse_links},
+ {"-lname", parse_lname, false},
+ {"-ls", parse_ls},
+ {"-maxdepth", parse_depth_limit, false},
+ {"-mindepth", parse_depth_limit, true},
+ {"-mmin", parse_time, BFS_STAT_MTIME, MINUTES},
+ {"-mnewer", parse_newer, BFS_STAT_MTIME},
+ {"-mount", parse_mount},
+ {"-mtime", parse_time, BFS_STAT_MTIME, DAYS},
+ {"-name", parse_name, false},
+ {"-newer", parse_newer, BFS_STAT_MTIME},
+ {"-newer", parse_newerxy, 0, 0, true},
+ {"-nocolor", parse_color, false},
+ {"-nogroup", parse_nogroup},
+ {"-nohidden", parse_nohidden},
+ {"-noignore_readdir_race", parse_ignore_races, false},
+ {"-noleaf", parse_noleaf},
{"-not"},
- {"-nouser", false, parse_nouser},
- {"-nowarn", false, parse_warn, false},
+ {"-nouser", parse_nouser},
+ {"-nowarn", parse_warn, false},
{"-o"},
- {"-ok", false, parse_exec, BFS_EXEC_CONFIRM},
- {"-okdir", false, parse_exec, BFS_EXEC_CONFIRM | BFS_EXEC_CHDIR},
+ {"-ok", parse_exec, BFS_EXEC_CONFIRM},
+ {"-okdir", parse_exec, BFS_EXEC_CONFIRM | BFS_EXEC_CHDIR},
{"-or"},
- {"-path", false, parse_path, false},
- {"-perm", false, parse_perm},
- {"-print", false, parse_print},
- {"-print0", false, parse_print0},
- {"-printf", false, parse_printf},
- {"-printx", false, parse_printx},
- {"-prune", false, parse_prune},
- {"-quit", false, parse_quit},
- {"-readable", false, parse_access, R_OK},
- {"-regex", false, parse_regex, 0},
- {"-regextype", false, parse_regextype},
- {"-rm", false, parse_delete},
- {"-samefile", false, parse_samefile},
- {"-size", false, parse_size},
- {"-sparse", false, parse_sparse},
- {"-true", false, parse_const, true},
- {"-type", false, parse_type, false},
- {"-uid", false, parse_user},
- {"-unique", false, parse_unique},
- {"-used", false, parse_used},
- {"-user", false, parse_user},
- {"-version", false, parse_version},
- {"-warn", false, parse_warn, true},
- {"-wholename", false, parse_path, false},
- {"-writable", false, parse_access, W_OK},
- {"-x", false, parse_mount},
- {"-xattr", false, parse_xattr},
- {"-xdev", false, parse_mount},
- {"-xtype", false, parse_type, true},
+ {"-path", parse_path, false},
+ {"-perm", parse_perm},
+ {"-print", parse_print},
+ {"-print0", parse_print0},
+ {"-printf", parse_printf},
+ {"-printx", parse_printx},
+ {"-prune", parse_prune},
+ {"-quit", parse_quit},
+ {"-readable", parse_access, R_OK},
+ {"-regex", parse_regex, 0},
+ {"-regextype", parse_regextype},
+ {"-rm", parse_delete},
+ {"-samefile", parse_samefile},
+ {"-size", parse_size},
+ {"-sparse", parse_sparse},
+ {"-true", parse_const, true},
+ {"-type", parse_type, false},
+ {"-uid", parse_user},
+ {"-unique", parse_unique},
+ {"-used", parse_used},
+ {"-user", parse_user},
+ {"-version", parse_version},
+ {"-warn", parse_warn, true},
+ {"-wholename", parse_path, false},
+ {"-writable", parse_access, W_OK},
+ {"-x", parse_mount},
+ {"-xattr", parse_xattr},
+ {"-xdev", parse_mount},
+ {"-xtype", parse_type, true},
{0},
};