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
Source

Summary

get()

Returns all supported IEx options with their respective values as a keyword list

get(name)

Get current value of the option name. Raises ArgumentError if name is not a known option

help(name)

Returns a string with the option's description. Raises ArgumentError if name is not a known option

list()

Returns all supported options as a list of names

print_help(name)

Same as help/1 but instead of returning a string, prints it

set(opts)

Set all options at once by providing a keyword list with option names and their corresponding values. This is generally obtained from get/0

set(name, value)

Sets the value for the option name to value

Functions

get()

Returns all supported IEx options with their respective values as a keyword list.

Source
get(name)

Get current value of the option name. Raises ArgumentError if name is not a known option.

Source
help(name)

Returns a string with the option's description. Raises ArgumentError if name is not a known option.

Source
list()

Returns all supported options as a list of names.

Source

Same as help/1 but instead of returning a string, prints it.

Source
set(opts)

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.

Source
set(name, value)

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.

Source