From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1P9KkY-0001xG-M8 for barebox@lists.infradead.org; Fri, 22 Oct 2010 16:45:51 +0000 From: Robert Schwebel Date: Fri, 22 Oct 2010 18:45:23 +0200 Message-Id: <1287765924-1856-32-git-send-email-r.schwebel@pengutronix.de> In-Reply-To: <1287765924-1856-1-git-send-email-r.schwebel@pengutronix.de> References: <1287765924-1856-1-git-send-email-r.schwebel@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 31/32] doc: unify documentation for 'cp' To: barebox@lists.infradead.org Signed-off-by: Robert Schwebel --- commands/cp.c | 24 ++++++++---------------- 1 files changed, 8 insertions(+), 16 deletions(-) diff --git a/commands/cp.c b/commands/cp.c index 2c35ba1..a99c9b5 100644 --- a/commands/cp.c +++ b/commands/cp.c @@ -51,7 +51,7 @@ static int do_cp(struct command *cmdtp, int argc, char *argv[]) if (S_ISDIR(statbuf.st_mode)) last_is_dir = 1; } - + if (argc > 3 && !last_is_dir) { printf("cp: target `%s' is not a directory\n", argv[argc - 1]); return 1; @@ -77,10 +77,13 @@ out: return ret; } -static const __maybe_unused char cmd_cp_help[] = -"Usage: cp \n" -"cp copies file to .\n" -"This command is file based only. See memcpy for memory copy\n"; +BAREBOX_CMD_HELP_START(cp) +BAREBOX_CMD_HELP_USAGE("cp \n") +BAREBOX_CMD_HELP_SHORT("cp copies file to .\n") +BAREBOX_CMD_HELP_TEXT ("This command is file based. If you want to copy between memory blocks,\n") +BAREBOX_CMD_HELP_TEXT ("use 'memcpy'.\n") + +BAREBOX_CMD_HELP_END BAREBOX_CMD_START(cp) .cmd = do_cp, @@ -88,14 +91,3 @@ BAREBOX_CMD_START(cp) BAREBOX_CMD_HELP(cmd_cp_help) BAREBOX_CMD_END -/** - * @page cp_command cp: Copy file - * - * Usage: cp \ [\] \ - * - * \c cp copies file \ to \ - * - * Currently only this form is supported and you have to specify the exact - * target filename (not a target directory).\n - * This command is file based only. See memcpy for generic memory copy - */ -- 1.7.2.3 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox