diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-04-20 00:30:44 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-04-20 00:30:44 +0200 |
commit | 4086aeb61b73edb580edf16d50e77422f0bbcfa1 (patch) | |
tree | c2254f3f076c169c5f340b2f1c2fd610d15354e6 | |
parent | 9a2e702f9d1204e2a807db55b6886cb72578a168 (diff) |
Add the ‘gen’ subcommand
-rw-r--r-- | make.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -63,13 +63,15 @@ main(int argc, char **argv) argv += optind; if (argc >= 1) { - if (!streq(*argv, "clean")) { - diex("invalid subcommand — ‘%s’", *argv); - exit(EXIT_FAILURE); - } cmd_t c = {}; - cmdadd(&c, "find", ".", "(", "-name", "*.[ao]", "-or", "-name", "*.so", - ")", "-delete"); + if (streq(*argv, "clean")) { + cmdadd(&c, "find", ".", "(", "-name", "*.[ao]", "-or", "-name", + "*.so", ")", "-delete"); + } else if (streq(*argv, "gen")) { + cmdadd(&c, "find", "gen", "-mindepth", "2", "-type", "f", + "-executable", "-not", "-name", "scale", "-exec", "{}", ";"); + } else + diex("invalid subcommand — ‘%s’", *argv); cmdput(c); CMDRC(c); } else { |