diff options
author | Robert Schwebel <r.schwebel@pengutronix.de> | 2010-07-12 18:03:05 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-11-01 16:23:08 +0100 |
commit | 511c5d8d0c0b1dcd0fd435fa1a2f58ba58df2af2 (patch) | |
tree | 210e929be8178aa4116fe2972d96f4d6e1e95ecc /include/command.h | |
parent | c84a37d52b8a40bf1fb62d1a9827f2fe59c15fa9 (diff) | |
download | barebox-511c5d8d0c0b1dcd0fd435fa1a2f58ba58df2af2.tar.gz barebox-511c5d8d0c0b1dcd0fd435fa1a2f58ba58df2af2.tar.xz |
doc: add macros to unify command help with doxygen
Currently we have duplicated all the information that appears online in
'help <command>' and in the doxygen documentation. This patch adds some
infrastructure to specify help texts only once and re-use them for the
integrated help as well as for the manual.
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
Diffstat (limited to 'include/command.h')
-rw-r--r-- | include/command.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/command.h b/include/command.h index 0be7a69538..e221546091 100644 --- a/include/command.h +++ b/include/command.h @@ -89,6 +89,15 @@ const struct command __barebox_cmd_##_name \ #define BAREBOX_CMD_END \ }; +#define BAREBOX_CMD_HELP_START(_name) \ +static const __maybe_unused char cmd_##_name##_help[] = + +#define BAREBOX_CMD_HELP_USAGE(_name) "Usage: " _name +#define BAREBOX_CMD_HELP_SHORT(_text) _text +#define BAREBOX_CMD_HELP_OPT(_opt, _desc) _opt "\t" _desc +#define BAREBOX_CMD_HELP_TEXT(_text) +#define BAREBOX_CMD_HELP_END ; + #ifdef CONFIG_LONGHELP #define BAREBOX_CMD_HELP(text) .help = text, #else |