diff options
author | Holger Schurig <holgerschurig@gmail.com> | 2014-05-13 16:14:05 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-05-14 07:59:55 +0200 |
commit | ab23d0bb3f66cfb7a97a8aa6b8007687ed7a6925 (patch) | |
tree | 5163ba7d9ce1fc0ddd144a1de59b7db1192911f6 /include/command.h | |
parent | 5a4d617a1c5bd7be7b28ead716589c3f488367c0 (diff) | |
download | barebox-ab23d0bb3f66cfb7a97a8aa6b8007687ed7a6925.tar.gz barebox-ab23d0bb3f66cfb7a97a8aa6b8007687ed7a6925.tar.xz |
commands: group 'help' output
The old output of "help" was just producing a long list, that usually
scrolled of the screen (even on a X11 terminal). This list is more
compact, and also sorted by groups.
The old output format (plus grouping) is now available with 'help -v'.
Example:
Information commands:
?, devinfo, help, iomem, meminfo, version
Boot commands:
boot, bootm, go, loadb, loads, loadx, loady, saves, uimage
...
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/command.h')
-rw-r--r-- | include/command.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/command.h b/include/command.h index ffc722ce23..15ce8d4862 100644 --- a/include/command.h +++ b/include/command.h @@ -50,6 +50,7 @@ struct command { const char *usage; /* Usage message (short) */ struct list_head list; /* List of commands */ + uint32_t group; #ifdef CONFIG_LONGHELP const char *help; /* Help message (long) */ #endif @@ -73,6 +74,19 @@ void barebox_cmd_usage(struct command *cmdtp); #define COMMAND_ERROR 1 #define COMMAND_ERROR_USAGE 2 +/* Note: keep this list in sync with commands/command.c */ +#define CMD_GRP_INFO 1 +#define CMD_GRP_BOOT 2 +#define CMD_GRP_ENV 3 +#define CMD_GRP_FILE 4 +#define CMD_GRP_PART 5 +#define CMD_GRP_SCRIPT 6 +#define CMD_GRP_NET 7 +#define CMD_GRP_CONSOLE 8 +#define CMD_GRP_MEM 9 +#define CMD_GRP_HWMANIP 10 +#define CMD_GRP_MISC 11 + #endif /* __ASSEMBLY__ */ #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -108,6 +122,8 @@ static const __maybe_unused char cmd_##_name##_help[] = #define BAREBOX_CMD_HELP(text) #endif +#define BAREBOX_CMD_GROUP(grp) .group = grp, + #endif /* DOXYGEN_SHOULD_SKIP_THIS */ int register_command(struct command *); |