1 | // SPDX-License-Identifier: GPL-3.0-or-later |
2 | |
3 | #include "mosapi.h" |
4 | |
5 | int main(int argc, char **argv) |
6 | { |
7 | if (argc < 2) |
8 | { |
9 | fprintf(stderr, format: "usage: %s <file>\n" , argv[0]); |
10 | return 1; |
11 | } |
12 | |
13 | bool has_error = false; |
14 | |
15 | for (int i = 1; i < argc; i++) |
16 | { |
17 | if (unlink(path: argv[i])) |
18 | { |
19 | fprintf(stderr, format: "failed to remove %s\n" , argv[i]); |
20 | has_error = true; |
21 | continue; |
22 | } |
23 | |
24 | printf(format: "removed %s\n" , argv[i]); |
25 | } |
26 | |
27 | return has_error ? 1 : 0; |
28 | } |
29 | |