[PATCH 06/13] doc: unify documentation for 'protect' and 'unprotect'

Robert Schwebel r.schwebel at pengutronix.de
Tue Nov 2 09:10:35 EDT 2010


Signed-off-by: Robert Schwebel <r.schwebel at pengutronix.de>
---
 commands/flash.c |   76 ++++++++++++++++++++++++++++++++----------------------
 1 files changed, 45 insertions(+), 31 deletions(-)

diff --git a/commands/flash.c b/commands/flash.c
index 4549f0a..c49de33 100644
--- a/commands/flash.c
+++ b/commands/flash.c
@@ -162,43 +162,57 @@ out:
 	return ret;
 }
 
-static const __maybe_unused char cmd_protect_help[] =
-"Usage: (un)protect <device> [area]\n"
-"(un)protect a flash device or parts of a device if an area specification\n"
-"is given\n";
+BAREBOX_CMD_HELP_START(protect)
+BAREBOX_CMD_HELP_USAGE("protect <device> [area]\n")
+BAREBOX_CMD_HELP_SHORT("protect a flash device (or parts of a device, if an area is specified)\n")
+BAREBOX_CMD_HELP_END
 
-BAREBOX_CMD_START(protect)
+BAREBOX_CMD_START(erase)
 	.cmd		= do_protect,
-	.usage		= "enable FLASH write protection",
+	.usage		= "enable flash write protection",
 	BAREBOX_CMD_HELP(cmd_protect_help)
 BAREBOX_CMD_END
 
-BAREBOX_CMD_START(unprotect)
-	.cmd		= do_protect,
-	.usage		= "disable FLASH write protection",
-	BAREBOX_CMD_HELP(cmd_protect_help)
-BAREBOX_CMD_END
+/**
+ * @page protect_command
+
+Protect the flash memory behind the device. It depends on the device
+given, what area will be protected. If the device represents the whole
+flash memory the whole memory will be protected. If the device
+represents a partition on a main flash memory, only this partition part
+will be protected.
+
+Refer addpart_command, delpart_command and devinfo_command for partition
+handling.
+
+\todo Rework this documentation, what is an 'area'? Explain more about
+flashes here.
 
-/** @page protect_command protect Protect a flash memory
- *
- * Usage is: protect \<devicee>
- *
- * Protect the flash memory behind the device. It depends on the device given,
- * what area will be protected. If the device represents the whole flash memory
- * the whole memory will be protected. If the device represents a partition on
- * a main flash memory, only this partition part will be protected.
- *
- * Refer \b addpart, \b delpart and \b devinfo for partition handling.
  */
 
-/** @page unprotect_command unprotect Unprotect a flash memory
- *
- * Usage is: unprotect \<devicee>
- *
- * Unprotect the flash memory behind the device. It depends on the device given,
- * what area will be unprotected. If the device represents the whole flash memory
- * the whole memory will be unprotected. If the device represents a partition
- * on a main flash memory, only this partition part will be unprotected.
- *
- * Refer \b addpart, \b delpart and \b devinfo for partition handling.
+BAREBOX_CMD_HELP_START(unprotect)
+BAREBOX_CMD_HELP_USAGE("unprotect <device> [area]\n")
+BAREBOX_CMD_HELP_SHORT("unprotect a flash device (or parts of a device, if an area is specified)\n")
+BAREBOX_CMD_HELP_END
+
+BAREBOX_CMD_START(erase)
+	.cmd		= do_unprotect,
+	.usage		= "enable flash write protection",
+	BAREBOX_CMD_HELP(cmd_unprotect_help)
+BAREBOX_CMD_END
+
+/**
+ * @page unprotect_command
+
+Unprotect the flash memory behind the device. It depends on the device given,
+what area will be unprotected. If the device represents the whole flash memory
+the whole memory will be unprotected. If the device represents a partition
+on a main flash memory, only this partition part will be unprotected.
+
+Refer addpart_command, delpart_command and devinfo_command for partition
+handling.
+
+\todo Rework this documentation, what does it mean?
+
  */
+
-- 
1.7.2.3




More information about the barebox mailing list