summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Schwebel <r.schwebel@pengutronix.de>2010-10-18 21:10:05 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2010-11-01 16:23:09 +0100
commit6723d7e6f04b5915a767595e30e638d85db745f7 (patch)
tree53370af702feebed38bdbee8bcf8aad1a148d295
parent2a2d59f174615ba6d08e88ffa68b516f83810d9b (diff)
downloadbarebox-6723d7e6f04b5915a767595e30e638d85db745f7.tar.gz
barebox-6723d7e6f04b5915a767595e30e638d85db745f7.tar.xz
doc: unify documentation for 'cp'
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
-rw-r--r--commands/cp.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/commands/cp.c b/commands/cp.c
index 2c35ba131c..ae8719b24b 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,19 @@ out:
return ret;
}
-static const __maybe_unused char cmd_cp_help[] =
-"Usage: cp <source> <destination>\n"
-"cp copies file <source> to <destination>.\n"
-"This command is file based only. See memcpy for memory copy\n";
+BAREBOX_CMD_HELP_START(cp)
+BAREBOX_CMD_HELP_USAGE("cp <source> <destination>\n")
+BAREBOX_CMD_HELP_SHORT("copy file from <source> to <destination>.\n")
+BAREBOX_CMD_HELP_END
+
+/**
+ * @page cp_command
+This command operates on files.
+
+If you want to copy between memory blocks, use 'memcpy'.
+
+\todo What does this mean? Add examples.
+ */
BAREBOX_CMD_START(cp)
.cmd = do_cp,
@@ -88,14 +97,3 @@ BAREBOX_CMD_START(cp)
BAREBOX_CMD_HELP(cmd_cp_help)
BAREBOX_CMD_END
-/**
- * @page cp_command cp: Copy file
- *
- * Usage: cp \<source> [\<source>] \<destination>
- *
- * \c cp copies file \<source> to \<destination>
- *
- * 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
- */