[PATCH 21/21] doc: unify documentation for 'tftp'

Robert Schwebel r.schwebel at pengutronix.de
Mon Nov 1 04:33:54 EDT 2010


Signed-off-by: Robert Schwebel <r.schwebel at pengutronix.de>
---
 Doxyfile   |    3 ++-
 net/tftp.c |   49 +++++++++++++++++++++----------------------------
 2 files changed, 23 insertions(+), 29 deletions(-)

diff --git a/Doxyfile b/Doxyfile
index f030584..d9ce22c 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -1069,7 +1069,8 @@ INCLUDE_FILE_PATTERNS  =
 
 PREDEFINED             = \
 			DOXYGEN_SHOULD_SKIP_THIS \
-			CONFIG_CMD_DEVINFO
+			CONFIG_CMD_DEVINFO \
+			CONFIG_NET_TFTP_PUSH
 
 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
 # this tag can be used to specify a list of macro names that should be expanded.
diff --git a/net/tftp.c b/net/tftp.c
index 6345a72..c7f9b8c 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -364,15 +364,29 @@ out_close:
 	return tftp_err == 0 ? 0 : 1;
 }
 
-static const __maybe_unused char cmd_tftp_help[] =
-"Usage: tftp <remotefile> [localfile]\n"
-"Load a file from a TFTP server.\n"
+BAREBOX_CMD_HELP_START(tftp)
 #ifdef CONFIG_NET_TFTP_PUSH
-"or\n"
-"       tftp -p <localfile> [remotefile]\n"
-"Upload a file to a TFTP server\n"
+BAREBOX_CMD_HELP_USAGE("tftp <remotefile> [localfile], tftp -p <localfile> [remotefile]\n")
+BAREBOX_CMD_HELP_SHORT("Load a file from or upload to TFTP server.")
+BAREBOX_CMD_HELP_END
+#else
+BAREBOX_CMD_HELP_USAGE("tftp <remotefile> [localfile]\n")
+BAREBOX_CMD_HELP_SHORT("Load a file from a TFTP server.")
+BAREBOX_CMD_HELP_END
 #endif
-;
+
+/**
+ * @page tftp_command
+
+The second file argument can be skipped in which case the first filename
+is used (without the directory part).
+
+\<localfile> can be the local filename or a device file under /dev.
+This also works for flash memory. Refer to \ref erase_command and \ref
+unprotect_command for flash preparation.
+
+\note This command is available only if enabled in menuconfig.
+ */
 
 BAREBOX_CMD_START(tftp)
 	.cmd		= do_tftpb,
@@ -384,24 +398,3 @@ BAREBOX_CMD_START(tftp)
 	BAREBOX_CMD_HELP(cmd_tftp_help)
 BAREBOX_CMD_END
 
-/**
- * @page tftp_command tftp
- *
- * Usage:
- *	tftp \<remotefilename\> [\<localfilename\>]
- *
- * or
- *
- *	tftp -p \<localfilename\> [\<remotefilename\>]
- *
- * Load a file from a tftp server or upload a file to a tftp server if
- * the -p option is given. The second file argument can be skipped in
- * which case the first filename is used (without the directory part).
- *
- * \<localfile> can be the local filename or a device file under /dev.
- * This also works for flash memory. Refer to \b erase, \b unprotect for
- * flash preparation.
- *
- * Note: This command is available only if enabled in menuconfig.
- */
-
-- 
1.7.2.3




More information about the barebox mailing list