apps/nshlib: (1) NSH prompt string is now configurable. nsh> is still the default. (2) Increase the default configuration for the maximum number of command line arguments to 7 (CONFIG_NSH_MAXARGUMENTS). This is needed for 'mount' with the -o option.
This commit is contained in:
parent
8116d10da3
commit
dbf152cbeb
@ -18,6 +18,12 @@ config NSH_LIBRARY
|
|||||||
|
|
||||||
if NSH_LIBRARY
|
if NSH_LIBRARY
|
||||||
|
|
||||||
|
config NSH_PROMPT_STRING
|
||||||
|
string "Prompt String"
|
||||||
|
default "nsh> "
|
||||||
|
---help---
|
||||||
|
Provide the shell prompt string, default is "nsh> ".
|
||||||
|
|
||||||
menuconfig NSH_MOTD
|
menuconfig NSH_MOTD
|
||||||
bool "Message of the Day (MOTD)"
|
bool "Message of the Day (MOTD)"
|
||||||
default n
|
default n
|
||||||
@ -139,10 +145,10 @@ config NSH_CMDPARMS
|
|||||||
|
|
||||||
config NSH_MAXARGUMENTS
|
config NSH_MAXARGUMENTS
|
||||||
int "Maximum number of command arguments"
|
int "Maximum number of command arguments"
|
||||||
default 6
|
default 7
|
||||||
---help---
|
---help---
|
||||||
The maximum number of NSH command arguments.
|
The maximum number of NSH command arguments.
|
||||||
Default: 6
|
Default: 7
|
||||||
|
|
||||||
config NSH_ARGCAT
|
config NSH_ARGCAT
|
||||||
bool "Concatenation of argument strings"
|
bool "Concatenation of argument strings"
|
||||||
|
15
nshlib/nsh.h
15
nshlib/nsh.h
@ -464,7 +464,7 @@
|
|||||||
|
|
||||||
/* This is the maximum number of arguments that will be accepted for a
|
/* This is the maximum number of arguments that will be accepted for a
|
||||||
* command. Here we attempt to select the smallest number possible depending
|
* command. Here we attempt to select the smallest number possible depending
|
||||||
* upon the of commands that are available. Most commands use six or fewer
|
* upon the of commands that are available. Most commands use seven or fewer
|
||||||
* arguments, but there are a few that require more.
|
* arguments, but there are a few that require more.
|
||||||
*
|
*
|
||||||
* This value is also configurable with CONFIG_NSH_MAXARGUMENTS. This
|
* This value is also configurable with CONFIG_NSH_MAXARGUMENTS. This
|
||||||
@ -472,10 +472,6 @@
|
|||||||
* commands that require more commands than NSH is aware of.
|
* commands that require more commands than NSH is aware of.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CONFIG_NSH_MAXARGUMENTS
|
|
||||||
# define CONFIG_NSH_MAXARGUMENTS 6
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CONFIG_NSH_MAXARGUMENTS < 11
|
#if CONFIG_NSH_MAXARGUMENTS < 11
|
||||||
# if defined(CONFIG_NET) && !defined(CONFIG_NSH_DISABLE_IFCONFIG)
|
# if defined(CONFIG_NET) && !defined(CONFIG_NSH_DISABLE_IFCONFIG)
|
||||||
# undef CONFIG_NSH_MAXARGUMENTS
|
# undef CONFIG_NSH_MAXARGUMENTS
|
||||||
@ -483,15 +479,6 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_NSH_MAXARGUMENTS < 7
|
|
||||||
# if defined(CONFIG_NET_UDP) && CONFIG_NFILE_DESCRIPTORS > 0
|
|
||||||
# if !defined(CONFIG_NSH_DISABLE_GET) || !defined(CONFIG_NSH_DISABLE_PUT)
|
|
||||||
# undef CONFIG_NSH_MAXARGUMENTS
|
|
||||||
# define CONFIG_NSH_MAXARGUMENTS 7
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Argument list size
|
/* Argument list size
|
||||||
*
|
*
|
||||||
* argv[0]: The command name.
|
* argv[0]: The command name.
|
||||||
|
@ -259,7 +259,7 @@ const char g_loginfailure[] = "Login failed!\n";
|
|||||||
|
|
||||||
/* The NSH prompt */
|
/* The NSH prompt */
|
||||||
|
|
||||||
const char g_nshprompt[] = "nsh> ";
|
const char g_nshprompt[] = CONFIG_NSH_PROMPT_STRING;
|
||||||
|
|
||||||
/* Common, message formats */
|
/* Common, message formats */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user