File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,16 @@ defmodule IEx.Options do
41
41
] ,
42
42
]
43
43
44
+ @ doc """
45
+ Returns all supported IEx options with their respective values as a keyword
46
+ list.
47
+ """
48
+ def get do
49
+ Enum . map list ( ) , fn name ->
50
+ { name , get ( name ) }
51
+ end
52
+ end
53
+
44
54
@ doc """
45
55
Get current value of the option `name`. Raises ArgumentError if name is not a
46
56
known option.
@@ -60,6 +70,18 @@ defmodule IEx.Options do
60
70
raise_option ( name )
61
71
end
62
72
73
+ @ doc """
74
+ Set all options at once by providing a keyword list with option names and
75
+ their corresponding values. This is generally obtained from `get/0`.
76
+
77
+ Returns a keyword list of old option values.
78
+ """
79
+ def set ( opts ) do
80
+ Enum . map opts , fn { name , val } ->
81
+ { name , set ( name , val ) }
82
+ end
83
+ end
84
+
63
85
@ doc """
64
86
Sets the value for the option `name` to `value`.
65
87
You can’t perform that action at this time.
0 commit comments