From 1389555ad58caa14d952cde1445ec35c047df361 Mon Sep 17 00:00:00 2001 From: nvt-se Date: Mon, 24 Nov 2008 15:18:27 +0000 Subject: [PATCH] adjusted shell for the generic remove command. --- apps/shell/shell-coffee.c | 18 +----------------- apps/shell/shell-file.c | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/apps/shell/shell-coffee.c b/apps/shell/shell-coffee.c index 3a09b3bf5..b1681ad9e 100644 --- a/apps/shell/shell-coffee.c +++ b/apps/shell/shell-coffee.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: shell-coffee.c,v 1.2 2008/07/03 21:13:13 adamdunkels Exp $ + * $Id: shell-coffee.c,v 1.3 2008/11/24 15:18:27 nvt-se Exp $ */ /** @@ -52,11 +52,6 @@ SHELL_COMMAND(format_command, "format", "format: format the flash-based Coffee file system", &shell_format_process); -PROCESS(shell_rm_process, "rm"); -SHELL_COMMAND(rm_command, - "rm", - "rm : remove the file named filename", - &shell_rm_process); /*---------------------------------------------------------------------------*/ PROCESS_THREAD(shell_format_process, ev, data) { @@ -81,20 +76,9 @@ PROCESS_THREAD(shell_format_process, ev, data) PROCESS_END(); } /*---------------------------------------------------------------------------*/ -PROCESS_THREAD(shell_rm_process, ev, data) -{ - PROCESS_BEGIN(); - - if(data != NULL) { - cfs_coffee_remove(data); - } - PROCESS_END(); -} -/*---------------------------------------------------------------------------*/ void shell_coffee_init(void) { shell_register_command(&format_command); - shell_register_command(&rm_command); } /*---------------------------------------------------------------------------*/ diff --git a/apps/shell/shell-file.c b/apps/shell/shell-file.c index 86e509061..5c1713058 100644 --- a/apps/shell/shell-file.c +++ b/apps/shell/shell-file.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: shell-file.c,v 1.6 2008/07/06 10:34:44 oliverschmidt Exp $ + * $Id: shell-file.c,v 1.7 2008/11/24 15:18:27 nvt-se Exp $ */ /** @@ -68,6 +68,11 @@ SHELL_COMMAND(read_command, "read", "read [offset]: read from file, with an optional offset", &shell_read_process); +PROCESS(shell_rm_process, "rm"); +SHELL_COMMAND(rm_command, + "rm", + "rm : remove the file named filename", + &shell_rm_process); /*---------------------------------------------------------------------------*/ PROCESS_THREAD(shell_ls_process, ev, data) { @@ -238,6 +243,16 @@ PROCESS_THREAD(shell_read_process, ev, data) PROCESS_END(); } /*---------------------------------------------------------------------------*/ +PROCESS_THREAD(shell_rm_process, ev, data) +{ + PROCESS_BEGIN(); + + if(data != NULL) { + cfs_remove(data); + } + PROCESS_END(); +} +/*---------------------------------------------------------------------------*/ void shell_file_init(void) { @@ -245,5 +260,6 @@ shell_file_init(void) shell_register_command(&write_command); shell_register_command(&append_command); shell_register_command(&read_command); + shell_register_command(&rm_command); } /*---------------------------------------------------------------------------*/