summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorJuergen Beisert <jbe@isonoe.(none)>2007-10-19 14:56:45 +0200
committerJuergen Beisert <jbe@isonoe.(none)>2007-10-19 14:56:45 +0200
commitafe73cff56de417ce21096476928f53a7515ddec (patch)
treeca75b8b93cc2b4b69fc9923162ea7c80d5ff3d2a /commands
parent18690c9c23d424f5a28d24f4369533745c4ddbb3 (diff)
downloadbarebox-afe73cff56de417ce21096476928f53a7515ddec.tar.gz
barebox-afe73cff56de417ce21096476928f53a7515ddec.tar.xz
doc added and some reorganised
Diffstat (limited to 'commands')
-rw-r--r--commands/cat.c21
-rw-r--r--commands/cd.c13
-rw-r--r--commands/cp.c21
-rw-r--r--commands/environment.c34
4 files changed, 86 insertions, 3 deletions
diff --git a/commands/cat.c b/commands/cat.c
index 7a8facd0e3..af33eca80c 100644
--- a/commands/cat.c
+++ b/commands/cat.c
@@ -1,6 +1,4 @@
/*
- * cat.c - conacatenate files
- *
* Copyright (c) 2007 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
*
* See file CREDITS for list of people who contributed to this
@@ -20,6 +18,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/**
+ * @file
+ * @brief Concatenate files to stdout command
+ */
+
#include <common.h>
#include <command.h>
#include <fs.h>
@@ -29,6 +32,11 @@
#include <xfuncs.h>
#include <malloc.h>
+/**
+ * @param[in] cmdtp FIXME
+ * @param[in] argc Argument count from command line
+ * @param[in] argv List of input arguments
+ */
static int do_cat(cmd_tbl_t *cmdtp, int argc, char *argv[])
{
int ret;
@@ -85,3 +93,12 @@ U_BOOT_CMD_START(cat)
.usage = "concatenate file(s)",
U_BOOT_CMD_HELP(cmd_cat_help)
U_BOOT_CMD_END
+
+/**
+ * @page cat_command cat (concatenate)
+ *
+ * Usage is: cat <file> [<file> ...]
+ *
+ * Concatenate files to stdout. Currently only printable characters
+ * and \\n and \\t are printed, but this should be optional
+ */
diff --git a/commands/cd.c b/commands/cd.c
index 4263d0922e..08c3a2d268 100644
--- a/commands/cd.c
+++ b/commands/cd.c
@@ -20,6 +20,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/**
+ * @file
+ * @brief Change working directory
+ */
+
#include <common.h>
#include <command.h>
#include <fs.h>
@@ -52,3 +57,11 @@ U_BOOT_CMD_START(cd)
.usage = "change working directory",
U_BOOT_CMD_HELP(cmd_cd_help)
U_BOOT_CMD_END
+
+/**
+ * @page cd_command cd (change working directory)
+ *
+ * Usage is: cd [<directory name>]
+ *
+ * Change to <directory name>. If called without argument, change to / (root)
+ */
diff --git a/commands/cp.c b/commands/cp.c
index ea0a91d467..e26ff1fa00 100644
--- a/commands/cp.c
+++ b/commands/cp.c
@@ -20,6 +20,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/**
+ * @file
+ * @brief "cp" command implementation
+ */
#include <common.h>
#include <command.h>
#include <fs.h>
@@ -32,6 +36,10 @@
#define RW_BUF_SIZE (ulong)4096
+/**
+ * @param[in] src FIXME
+ * @param[out] dst FIXME
+ */
static int copy_file(const char *src, const char *dst)
{
char *rw_buf = NULL;
@@ -79,6 +87,11 @@ out:
return ret;
}
+/**
+ * @param[in] cmdtp FIXME
+ * @param[in] argc Argument count from command line
+ * @param[in] argv List of input arguments
+ */
static int do_cp ( cmd_tbl_t *cmdtp, int argc, char *argv[])
{
int ret = 1;
@@ -134,3 +147,11 @@ U_BOOT_CMD_START(cp)
.usage = "copy files",
U_BOOT_CMD_HELP(cmd_cp_help)
U_BOOT_CMD_END
+
+/**
+ * @page cp_command cp (copy)
+ *
+ * Usage: cp <source> [<source>] <destination>
+ *
+ * FIXME
+ */
diff --git a/commands/environment.c b/commands/environment.c
index 999a5f3fb4..b5517aa977 100644
--- a/commands/environment.c
+++ b/commands/environment.c
@@ -20,6 +20,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/**
+ * @file
+ * @brief Managing environment and environment variables
+ */
+
#ifdef __U_BOOT__
#include <common.h>
#include <command.h>
@@ -205,7 +210,7 @@ out:
}
static __maybe_unused char cmd_saveenv_help[] =
-"Usage: saveenv [DIRECTORY] [ENVFS]\n"
+"Usage: saveenv [<envfs>] [<directory>]\n"
"Save the files in <directory> to the persistent storage device <envfs>.\n"
"<envfs> is normally a block in flash, but could be any other file.\n"
"If ommitted <directory> defaults to /env and <envfs> defaults to /dev/env0.\n"
@@ -219,6 +224,20 @@ U_BOOT_CMD_START(saveenv)
U_BOOT_CMD_END
#endif /* __U_BOOT__ */
+/**
+ * @page saveenv_command saveenv
+ *
+ * Usage: saveenv [<envfs>] [<directory>]
+ *
+ * Save the files in <directory> to the persistent storage device <envfs>.
+ * <envfs> is normally a block in flash, but could be any other file.
+ *
+ * If ommitted <directory> defaults to /env and <envfs> defaults to
+ * /dev/env0.
+ *
+ * @note envfs can only handle files. Directories are skipped silently.
+ */
+
int envfs_load(char *filename, char *dir)
{
struct envfs_super super;
@@ -349,3 +368,16 @@ U_BOOT_CMD_START(loadenv)
U_BOOT_CMD_HELP(cmd_loadenv_help)
U_BOOT_CMD_END
#endif /* __U_BOOT__ */
+
+/**
+ * @page loadenv_command loadenv
+ *
+ * Usage: loadenv [<directory>] [<envfs>]
+ *
+ * Load the persistent storage contained in <envfs> to the directory <directory>.
+ *
+ * If ommitted <directory> defaults to /env and <envfs> defaults to
+ * /dev/env0.
+ *
+ * @note envfs can only handle files. Directories are skipped silently.
+ */