Skip to content

Commit

Permalink
1.3.0, document env() lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed May 13, 2013
1 parent 16139f5 commit 041c5da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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" : {
Expand Down
5 changes: 5 additions & 0 deletions readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit 041c5da

Please sign in to comment.