chore: update readme for new option

This commit is contained in:
Nicholas Krul 2021-03-10 14:48:16 +11:00 committed by Todd Bluhm
parent 53f4549001
commit f47b9f3c63
No known key found for this signature in database
GPG Key ID: 9CF312607477B8AB

View File

@ -57,17 +57,17 @@ To use a custom env filename or path, pass the `-f` flag. This is a major breaki
Usage: env-cmd [options] -- <command> [...args]
Options:
-v, --version output the version number
-e, --environments [envs...] The rc file environment(s) to use
-f, --file [path] Custom env file path or .rc file path if '-e' used (default path: ./.env or
./.env-cmdrc.(js|cjs|mjs|json))
-x, --expand-envs Replace $var in args and command with environment variables
--fallback Fallback to default env file path, if custom env file path not found
--no-override Do not override existing environment variables
--silent Ignore any env-cmd errors and only fail on executed program failure.
--use-shell Execute the command in a new shell with the given environment
--verbose Print helpful debugging information
-h, --help display help for command
-v, --version output the version number
-e, --environments [env1,env2,...] The rc file environment(s) to use
-f, --file [path] Custom env file path (default path: ./.env)
-x, --expand-envs Replace $var and ${var} in args and command with environment variables
--fallback Fallback to default env file path, if custom env file path not found
--no-override Do not override existing environment variables
--silent Ignore any env-cmd errors and only fail on executed program failure.
--use-shell Execute the command in a new shell with the given environment
--verbose Print helpful debugging information
--recursive Replace $var and ${var} in env file with the referenced environment variable
-h, --help output usage information
```
## 🔬 Advanced Usage
@ -129,14 +129,14 @@ commands together that share the same environment variables.
```
### Asynchronous env file support
EnvCmd supports reading from asynchronous `.env` files. Instead of using a `.env` file, pass in a `.js`
file that exports either an object or a `Promise` resolving to an object (`{ ENV_VAR_NAME: value, ... }`). Asynchronous `.rc`
files are also supported using `.js` file extension and resolving to an object with top level environment
names (`{ production: { ENV_VAR_NAME: value, ... } }`).
**Terminal**
```sh
./node_modules/.bin/env-cmd -f ./async-file.js -- node index.js
```