diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2015-09-08 14:54:15 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2015-09-08 17:04:53 -0400 |
commit | 4e29ac9d031d623b9bdb74f45ac5c14f9f2eadbd (patch) | |
tree | 3bbbd7f40b543e14229a85e5e64b8c8f1bcc0c6d /bfs.c | |
parent | 3c04b862ff35e2c040adbdb4d17310bff1f8cb35 (diff) | |
download | bfs-4e29ac9d031d623b9bdb74f45ac5c14f9f2eadbd.tar.xz |
Add -depth support.
The resulting order is fairly weird, as files are still returned in
breadth-first order, but directories are returned in a backwards order
based on when their reference counts drop to zero. But it's good enough
for -delete support.
Diffstat (limited to 'bfs.c')
-rw-r--r-- | bfs.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -450,6 +450,9 @@ static expression *parse_literal(parser_state *state) { } else if (strcmp(arg, "-nocolor") == 0) { state->cl->color = false; return new_option(state); + } else if (strcmp(arg, "-depth") == 0) { + state->cl->flags |= BFTW_DEPTH; + return new_option(state); } else if (strcmp(arg, "-false") == 0) { return new_test(state, eval_false); } else if (strcmp(arg, "-hidden") == 0) { |