From 9a3db48a553a6d62d9954d6b20327e95505578cc Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 10 Jan 2014 18:42:24 -0600 Subject: Add support for backquoated commands as command arguments --- apps/nshlib/Kconfig | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'apps/nshlib/Kconfig') diff --git a/apps/nshlib/Kconfig b/apps/nshlib/Kconfig index 2a96b851b..7d12d4d65 100644 --- a/apps/nshlib/Kconfig +++ b/apps/nshlib/Kconfig @@ -277,6 +277,34 @@ config NSH_DISABLE_SEMICOLON command separated by a semicolon. You can disable this feature to save a little memory on FLASH challenged platforms. +config NSH_FUNCPARMS + bool "Enable function parameters" + default n + ---help--- + If selected, then the output from cmds, from file applications, and + from NSH built-in commands can be used as arguments to other + commands. The entity to be executed is identified by enclosing the + command line in back quotes. For example, + + set FOO `myprogram $BAR` + + Will execute the program named myprogram passing it the value of the + environment variable BAR. The value of the environment variable FOO + is then set output of myprogram on stdout. + + This feature is disabled by default. + +config NSH_TMPDIR + string "Temporary file directory" + default "/tmp" + depends on NSH_FUNCPARMS + ---help--- + If NSH_FUNCPARMS is selected, then function output will be retained + in a temporary file. In that case, this string must be provided to + specify the full path to a directory where temporary files can be + created. This would be a good application of RAM disk: To provide + temporary storage for function output. + config NSH_MAXARGUMENTS int "Maximum number of command arguments" default 6 @@ -284,6 +312,22 @@ config NSH_MAXARGUMENTS The maximum number of NSH command arguments. Default: 6 +config NSH_ENVCAT + bool "Concatenation of environment variables" + default n + ---help--- + Support concatenation of strings with environment variables. For + example: + + set FOO XYZ + set BAR 123 + set FOOBAR ABC_${FOO}_${BAR} + + would set the environment variable FOO to XYZ, BAR to 123 and FOOBAR + to ABC_XYZ_123. If NSH_ENV, then a slightly small FLASH footprint + results but then also only simple environment variables like $FOO + can be used on the command line. + config NSH_NESTDEPTH int "Maximum command nesting" default 3 -- cgit v1.2.3