IEx.Options
Provides an interface for adjusting options of the running IEx session.
Changing options is usually done inside an IEx session or in your .iex.exs file.
See h(IEx) for more info on the latter.
If the value of an option is a keyword list, only those keys that are mentioned will be changed. The rest of the sub-options will keep their current values. Any extraneous keys are filtered out, i.e. not used.
To get the list of all supported options, use IEx.Options.list/0.
You can also get an option's description using IEx.Options.print_help/1.
Examples
iex(1)> ArgumentError[]
ArgumentError[message: "argument error"]
iex(2)> IEx.Options.set :inspect, records: false
[limit: 50, records: true]
iex(3)> ArgumentError[]
{ArgumentError,:__exception__,"argument error"}
iex(4)> IEx.Options.list
[:colors,:inspect]
iex(5)> IEx.Options.print_help :colors
This is an aggregate option that encapsulates all color settings used
by the shell.
... # omitted content
Summary
| get() | Returns all supported IEx options with their respective values as a keyword list |
| get(name) | Get current value of the option |
| help(name) | Returns a string with the option's description. Raises |
| list() | Returns all supported options as a list of names |
| print_help(name) | Same as |
| set(opts) | Set all options at once by providing a keyword list with option names and
their corresponding values. This is generally obtained from |
| set(name, value) | Sets the value for the option |
Functions
Returns all supported IEx options with their respective values as a keyword list.
Get current value of the option name. Raises ArgumentError if name is not a
known option.
Returns a string with the option's description. Raises ArgumentError
if name is not a known option.
Set all options at once by providing a keyword list with option names and
their corresponding values. This is generally obtained from get/0.
Returns a keyword list of old option values.
Sets the value for the option name to value.
Returns the option's previous value in the case of success.
If name is not a known option or if value is invalid, raises
ArgumentError.