blob: 83a0b027de1927032ee99c56bf3d3fb11629fef3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#include <common.h>
#include <command.h>
#include <fs.h>
#include <errno.h>
static int do_rmdir(struct command *cmdtp, int argc, char *argv[])
{
int i = 1;
if (argc < 2)
return COMMAND_ERROR_USAGE;
while (i < argc) {
if (rmdir(argv[i])) {
printf("could not remove %s: %s\n", argv[i], errno_str());
return 1;
}
i++;
}
return 0;
}
static const __maybe_unused char cmd_rmdir_help[] =
"Usage: rmdir [directories]\n"
"Remove directories. The directories have to be empty.\n";
BAREBOX_CMD_START(rmdir)
.cmd = do_rmdir,
.usage = "remove directorie(s)",
BAREBOX_CMD_HELP(cmd_rmdir_help)
BAREBOX_CMD_END
|