-
Notifications
You must be signed in to change notification settings - Fork 27
/
config_doc.yaml
133 lines (105 loc) · 3.51 KB
/
config_doc.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
- DocumentID: config
Title: >+
Shell Configuration And Settings (`config`)
CategoryID: commands
SubCategoryIDs: [ commands.shell ]
Summary: >-
Query or define Murex runtime settings
Description: |-
Rather than Murex runtime settings being definable via obscure environmental
variables, Murex instead supports a registry of config defined via the
`config` command. This means any preferences and/or runtime config becomes
centralised and discoverable.
## Terminology
The following terms have special means with regards to `config`:
### app
_app_ refers to a grouped category of settings. For example the name of an
integration or builtin.
Other _app_ names include
* `shell`: for "global" (system wide) Murex settings
* `proc`: for scoped Murex settings
* `http`: for settings that are applied to any processes which use the builtin
HTTP user agent (eg `open`, `get`, `getfile`, `post`)
* `test`: settings for Murex's test frameworks
* `index`: settings for `[` (index)
### key
_key_ refers to the config setting itself. For example the _app_ might be `http`
but the _key_ might be `timeout` - where the _key_, in this instance, holds the
value for how long any HTTP user agents might wait before timing out.
### value
_value_ is the actual value of a setting. So the value for _app_: `http`, _key_:
`timeout` might be `10`. eg
```
» config get http timeout
10
```
Usage: |-
### Get value
```
config get app key -> <stdout>
```
### Set value
```
config set app key value
<stdin> -> config set app key
config eval app key { code-block }
```
### Reset to default
```
!config app key
config default app key
```
### Define custom configs
```
config define app key { json }
```
Examples: |-
### eval
Using `eval` to append to an array (in this instance, adding a function
name to the list of "safe" commands):
```
» config eval shell safe-commands { -> append function-name }
```
You could also use the `~>` operator too:
```
» config eval shell safe-commands { ~> %[function-name] }
```
Flags:
get: >-
Output the currently held config _value_ without changing it
set: >-
Change the _value_ of an _app_'s _key_. `set` does not print any output
default: >-
Reset a the value of _app_'s _key_ to its default _value_
(the default _value_ is defined by the same process that defines the config field)
define: >-
Allows you to create custom config options.
See {{bookmark "Custom Config Directives" "config" "custom-config-directives"}} to learn how to use `define`
Detail: |-
### scope
Settings in `config`, by default, are scoped per function and module. Any
functions called will inherit the settings of it's caller parent. However any
child functions that then change the settings will only change settings for it's
own function and not the parent caller.
### global
Global settings defined inside a function will affect settings queried inside
another executing function (same concept as global variables).
## Custom Config Directives
{{ include "builtins/core/config/config_doc.inc.md" }}
Synonyms:
- config
- "!config"
Related:
- runtime
- open
- event
- append
- function
- match
- get
- post
- getfile
- item-index
- element
- create-object
- alter