[PPC] Move include/asm-ppc/arch-* to arch/ppc/*/include/mach
[barebox-mini2440.git] / commands / rm.c
bloba5b29d2553da2527a0beeda571d7fb8b1cb45fa8
1 /*
2 * rm.c - remove files
4 * Copyright (c) 2007 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
6 * See file CREDITS for list of people who contributed to this
7 * project.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2
11 * as published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include <common.h>
23 #include <command.h>
24 #include <fs.h>
25 #include <errno.h>
27 static int do_rm (cmd_tbl_t *cmdtp, int argc, char *argv[])
29 int i = 1;
31 if (argc < 2)
32 return COMMAND_ERROR_USAGE;
34 while (i < argc) {
35 if (unlink(argv[i])) {
36 printf("could not remove %s: %s\n", argv[i], errno_str());
37 return 1;
39 i++;
42 return 0;
45 static const __maybe_unused char cmd_rm_help[] =
46 "Usage: rm [FILES]\n"
47 "Remove files\n";
49 U_BOOT_CMD_START(rm)
50 .cmd = do_rm,
51 .usage = "remove files",
52 U_BOOT_CMD_HELP(cmd_rm_help)
53 U_BOOT_CMD_END