diff options
author | Robert Schwebel <r.schwebel@pengutronix.de> | 2010-12-13 21:01:36 +0100 |
---|---|---|
committer | Robert Schwebel <r.schwebel@pengutronix.de> | 2010-12-17 21:28:41 +0100 |
commit | c47b26546421a04f610d0c9bea5dcc1cd01d9917 (patch) | |
tree | 6a3e70f9bfb5bc696328860433e75e6e2d82832c | |
parent | 0de6b6b3065bac6a0a295c12dcdced240c4eb790 (diff) | |
download | barebox-c47b26546421a04f610d0c9bea5dcc1cd01d9917.tar.gz barebox-c47b26546421a04f610d0c9bea5dcc1cd01d9917.tar.xz |
doc: add documentation for 'source' command
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
-rw-r--r-- | Documentation/commands.dox | 2 | ||||
-rw-r--r-- | common/hush.c | 22 |
2 files changed, 13 insertions, 11 deletions
diff --git a/Documentation/commands.dox b/Documentation/commands.dox index 430cc520..7f4e4897 100644 --- a/Documentation/commands.dox +++ b/Documentation/commands.dox @@ -94,7 +94,7 @@ available in @a Barebox: @li @subpage setenv_command @li @subpage sh @li @subpage sleep_command -@li @subpage source +@li @subpage source_command @li @subpage test_command @li @subpage timeout_command @li @subpage true_command diff --git a/common/hush.c b/common/hush.c index 77610bba..49471736 100644 --- a/common/hush.c +++ b/common/hush.c @@ -1691,21 +1691,23 @@ static int do_source(struct command *cmdtp, int argc, char *argv[]) static const char *source_aliases[] = { ".", NULL}; -static const __maybe_unused char cmd_source_help[] = -"Usage: . filename [arguments]\n" -"or source filename [arguments]\n" -"\n" -"Read and execute commands from filename in the current shell\n" -"environment and return the exit status of the last command exe-\n" -"cuted from filename\n"; +BAREBOX_CMD_HELP_START(source) +BAREBOX_CMD_HELP_USAGE(". FILE [ARGS], source FILE [ARGS]\n") +BAREBOX_CMD_HELP_SHORT("Read and execute shell commands in the current shell.\n") +BAREBOX_CMD_HELP_END + +/** + * @page source_command -static const __maybe_unused char cmd_source_usage[] = -"execute shell script in current shell environment"; +The commands are executed in the current shell environment and return +the exit status of the last command executed from FILE. + + */ BAREBOX_CMD_START(source) .aliases = source_aliases, .cmd = do_source, - .usage = cmd_source_usage, + .usage = "execute shell script in current shell environment" BAREBOX_CMD_HELP(cmd_source_help) BAREBOX_CMD_END |