Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

erts: Polish open_port env opts documentation #8735

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions erts/preloaded/src/erlang.erl
Original file line number Diff line number Diff line change
Expand Up @@ -7128,20 +7128,17 @@ follows:
`{spawn_executable, FileName}`. The external program starts using `Dir` as its
working directory. `Dir` must be a string.

- **`{env, Env}`** - Types:
  `Name = ``t:os:env_var_name/0`
  `Val = ``t:os:env_var_value/0`` | false`
  `Env = [{Name, Val}]`

Only valid for `{spawn, Command}`, and `{spawn_executable, FileName}`. The
environment of the started process is extended using the environment
- **`{env, Env}`** - Only valid for `{spawn, Command}`, and `{spawn_executable, FileName}`.
The environment of the started process is extended using the environment
specifications in `Env`.

`Env` is to be a list of tuples `{Name, Val}`, where `Name` is the name of an
environment variable, and `Val` is the value it is to have in the spawned port
process. Both `Name` and `Val` must be strings. The one exception is `Val`
being the atom `false` (in analogy with `os:getenv/1`), which removes the
environment variable.
`Env` is to be a list of tuples `{Name, Val}`, where `Name` is a `t:os:env_var_name/0`
representing the name of an environment variable, and `Val` is a `t:os:env_var_name/0`
representing the value it is to have in the spawned port process. Both `Name` and `Val` must
be strings.

If `Val` is set to the atom `false` or the empty string (that is `""` or `[]`), open_port
will consider those variables unset just as if `os:unsetenv/1` had been called.

For information about encoding requirements, see documentation of the types
for `Name` and `Val`.
Expand Down Expand Up @@ -7327,7 +7324,7 @@ by passing command-line flag [`+Q`](erl_cmd.md#max_ports) to [erl](erl_cmd.md).
| stream
| {line, L :: non_neg_integer()}
| {cd, Dir :: string() | binary()}
| {env, Env :: [{Name :: os:env_var_name(), Val :: os:env_var_value() | false}]}
| {env, Env :: [{Name :: os:env_var_name(), Val :: os:env_var_value() | [] | false}]}
| {args, [string() | binary()]}
| {arg0, string() | binary()}
| exit_status
Expand Down
Loading