Update NSH documentation; Add option to reduce size of help commnd without completely eliminating it
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5009 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
parent
003728be02
commit
ffd511a6a7
|
@ -371,9 +371,15 @@ o get [-b|-n] [-f <local-path>] -h <ip-address> <remote-path>
|
||||||
Selects either binary ("octect") or test ("netascii") transfer
|
Selects either binary ("octect") or test ("netascii") transfer
|
||||||
mode. Default: text.
|
mode. Default: text.
|
||||||
|
|
||||||
o help
|
o help [-v] [<cmd>]
|
||||||
|
|
||||||
Presents summary information about each command to console.
|
Presents summary information about NSH commands to console. Options:
|
||||||
|
|
||||||
|
-v
|
||||||
|
Show verbose output will full command usage
|
||||||
|
|
||||||
|
<cmd>
|
||||||
|
Show full command usage only for this command
|
||||||
|
|
||||||
o ifconfig
|
o ifconfig
|
||||||
|
|
||||||
|
@ -889,6 +895,9 @@ also allow it to squeeze into very small memory footprints.
|
||||||
CONFIG_NSH_DISABLE_UNSET, CONFIG_NSH_DISABLE_USLEEP, CONFIG_NSH_DISABLE_WGET,
|
CONFIG_NSH_DISABLE_UNSET, CONFIG_NSH_DISABLE_USLEEP, CONFIG_NSH_DISABLE_WGET,
|
||||||
CONFIG_NSH_DISABLE_XD
|
CONFIG_NSH_DISABLE_XD
|
||||||
|
|
||||||
|
Verbose help output can be suppressed by defining CONFIG_NSH_HELP_TERSE. In that
|
||||||
|
case, the help command is still available but will be slightly smaller.
|
||||||
|
|
||||||
NSH-Specific Configuration Settings
|
NSH-Specific Configuration Settings
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
|
|
@ -211,7 +211,11 @@ static const struct cmdmap_s g_cmdmap[] =
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_NSH_DISABLE_HELP
|
#ifndef CONFIG_NSH_DISABLE_HELP
|
||||||
{ "help", cmd_help, 1, 3, "[-v] [cmd]" },
|
# ifdef CONFIG_NSH_HELP_TERSE
|
||||||
|
{ "help", cmd_help, 1, 2, "[<cmd>]" },
|
||||||
|
#else
|
||||||
|
{ "help", cmd_help, 1, 3, "[-v] [<cmd>]" },
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_NET
|
#ifdef CONFIG_NET
|
||||||
|
@ -453,7 +457,7 @@ static inline void help_cmdlist(FAR struct nsh_vtbl_s *vtbl)
|
||||||
* Name: help_usage
|
* Name: help_usage
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef CONFIG_NSH_DISABLE_HELP
|
#if !defined(CONFIG_NSH_DISABLE_HELP) && !defined(CONFIG_NSH_HELP_TERSE)
|
||||||
static inline void help_usage(FAR struct nsh_vtbl_s *vtbl)
|
static inline void help_usage(FAR struct nsh_vtbl_s *vtbl)
|
||||||
{
|
{
|
||||||
nsh_output(vtbl, "NSH command forms:\n");
|
nsh_output(vtbl, "NSH command forms:\n");
|
||||||
|
@ -526,7 +530,7 @@ static int help_cmd(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd)
|
||||||
* Name: help_allcmds
|
* Name: help_allcmds
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef CONFIG_NSH_DISABLE_HELP
|
#if !defined(CONFIG_NSH_DISABLE_HELP) && !defined(CONFIG_NSH_HELP_TERSE)
|
||||||
static inline void help_allcmds(FAR struct nsh_vtbl_s *vtbl)
|
static inline void help_allcmds(FAR struct nsh_vtbl_s *vtbl)
|
||||||
{
|
{
|
||||||
FAR const struct cmdmap_s *cmdmap;
|
FAR const struct cmdmap_s *cmdmap;
|
||||||
|
@ -569,12 +573,15 @@ static inline void help_builtins(FAR struct nsh_vtbl_s *vtbl)
|
||||||
#ifndef CONFIG_NSH_DISABLE_HELP
|
#ifndef CONFIG_NSH_DISABLE_HELP
|
||||||
static int cmd_help(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
static int cmd_help(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||||
{
|
{
|
||||||
bool verbose = false;
|
|
||||||
FAR const char *cmd = NULL;
|
FAR const char *cmd = NULL;
|
||||||
|
#ifdef CONFIG_NSH_HELP_TERSE
|
||||||
|
bool verbose = false;
|
||||||
int i;
|
int i;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* The command may be followed by a verbose option */
|
/* The command may be followed by a verbose option */
|
||||||
|
|
||||||
|
#ifdef CONFIG_NSH_HELP_TERSE
|
||||||
i = 1;
|
i = 1;
|
||||||
if (argc > i)
|
if (argc > i)
|
||||||
{
|
{
|
||||||
|
@ -598,6 +605,12 @@ static int cmd_help(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||||
{
|
{
|
||||||
help_usage(vtbl);
|
help_usage(vtbl);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
if (argc > 1)
|
||||||
|
{
|
||||||
|
cmd = argv[1];
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Are we showing help on a single command? */
|
/* Are we showing help on a single command? */
|
||||||
|
|
||||||
|
@ -612,6 +625,7 @@ static int cmd_help(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||||
{
|
{
|
||||||
/* In verbose mode, show detailed help for all commands */
|
/* In verbose mode, show detailed help for all commands */
|
||||||
|
|
||||||
|
#ifdef CONFIG_NSH_HELP_TERSE
|
||||||
if (verbose)
|
if (verbose)
|
||||||
{
|
{
|
||||||
nsh_output(vtbl, "Where <cmd> is one of:\n");
|
nsh_output(vtbl, "Where <cmd> is one of:\n");
|
||||||
|
@ -621,6 +635,7 @@ static int cmd_help(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||||
/* Otherwise, just show the list of command names */
|
/* Otherwise, just show the list of command names */
|
||||||
|
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
nsh_output(vtbl, "help usage:");
|
nsh_output(vtbl, "help usage:");
|
||||||
help_cmd(vtbl, "help");
|
help_cmd(vtbl, "help");
|
||||||
|
|
|
@ -1046,12 +1046,27 @@ get [-b|-n] [-f <local-path>] -h <ip-address> <remote-path>
|
||||||
|
|
||||||
<p><b>Command Syntax:</b></p>
|
<p><b>Command Syntax:</b></p>
|
||||||
<ul><pre>
|
<ul><pre>
|
||||||
help
|
help [-v] [<cmd>]
|
||||||
</pre></ul>
|
</pre></ul>
|
||||||
<p>
|
<p>
|
||||||
<b>Synopsis</b>.
|
<b>Synopsis</b>.
|
||||||
Presents summary information about each command to console.
|
Presents summary information about NSH commands to console.
|
||||||
</p>
|
</p>
|
||||||
|
<p><b>Options:</b></p>
|
||||||
|
<ul><table>
|
||||||
|
<tr>
|
||||||
|
<td><b><code>-v</code></b></td>
|
||||||
|
<td>
|
||||||
|
how verbose output will full command usage.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b><code><cmd></code></b></td>
|
||||||
|
<td>
|
||||||
|
Show full command usage only for this command.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table></ul>
|
||||||
|
|
||||||
<table width ="100%">
|
<table width ="100%">
|
||||||
<tr bgcolor="#e4e4e4">
|
<tr bgcolor="#e4e4e4">
|
||||||
|
@ -2031,7 +2046,7 @@ nsh>
|
||||||
<td><code>CONFIG_NSH_DISABLE_GET</code></td>
|
<td><code>CONFIG_NSH_DISABLE_GET</code></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><b><code>help</code></b></td>
|
<td><b><code>help</code></b><sup>5</sup></td>
|
||||||
<td><br></td>
|
<td><br></td>
|
||||||
<td><code>CONFIG_NSH_DISABLE_HELP</code></td>
|
<td><code>CONFIG_NSH_DISABLE_HELP</code></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -2192,6 +2207,10 @@ nsh>
|
||||||
<sup>4</sup><small>
|
<sup>4</sup><small>
|
||||||
<code>CONFIG_FS_WRITABLE</code> is not a user configuration but is set automatically
|
<code>CONFIG_FS_WRITABLE</code> is not a user configuration but is set automatically
|
||||||
if any writable filesystem is selected. At present, this is only <code>CONFIG_FS_FAT</code>.</small><br>
|
if any writable filesystem is selected. At present, this is only <code>CONFIG_FS_FAT</code>.</small><br>
|
||||||
|
<sup>5</sup><small>
|
||||||
|
Verbose help output can be suppressed by defining <code>CONFIG_NSH_HELP_TERSE</code>.
|
||||||
|
In that case, the help command is still available but will be slightly smaller.
|
||||||
|
</small>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<table width ="100%">
|
<table width ="100%">
|
||||||
|
|
Loading…
Reference in New Issue