From 041c5da88800b4e15f0ed023049050b11b623a23 Mon Sep 17 00:00:00 2001 From: James Halliday Date: Mon, 13 May 2013 06:41:19 -0700 Subject: [PATCH] 1.3.0, document env() lookups --- package.json | 2 +- readme.markdown | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 2e18d38..9e8bcd6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name" : "shell-quote", - "version" : "1.2.0", + "version" : "1.3.0", "description" : "quote and parse shell commands", "main" : "index.js", "directories" : { diff --git a/readme.markdown b/readme.markdown index 48b6bfd..82473de 100644 --- a/readme.markdown +++ b/readme.markdown @@ -81,6 +81,11 @@ Return an array of arguments from the quoted string `cmd`. Interpolate embedded bash-style `$VARNAME` and `${VARNAME}` variables with the `env` object which like bash will replace undefined variables with `""`. +`env` is usually an object but it can also be a function to perform lookups. +When `env(key)` returns a string, its result will be output just like `env[key]` +would. When `env(key)` returns an object, it will be inserted into the result +array like the operator objects. + When a bash operator is encountered, the element in the array with be an object with an `"op"` key set to the operator string. For example: