You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not possible to name a variable prefixing an *underscore* (`_`). So, `_Name` is an invalid name. Variable names can include `A-Z, a-z, 0-9, ., -, _`.
33
+
::::tip [Naming variables]
34
+
35
+
Variable names can include
36
+
37
+
-`A-Z`
38
+
-`a-z`
39
+
-`0-9`
40
+
-`.` dot
41
+
-`-` dash
42
+
-`_` underscore
43
+
44
+
:::warning
34
45
35
-
### Passing variables from console
46
+
It is not possible to start a variable name with _underscore_ (`_`). Therefore, `_Name` is an invalid name, when `Name_` is valid.
36
47
37
-
It's possible to pass variables from console while invoking `chk` command. e.g:
48
+
:::
38
49
39
-
So, for following HTTP specification:
50
+
::::
40
51
41
-
```yml [title="request-someurl.chk"]
52
+
## Passing variables from console
53
+
54
+
It's possible to pass variables from console while invoking `chk` command. Let's have following HTTP specification:
Then CHKware will replace `<% emailAddr %>` with `"user@domain.ext"`, before making request.
86
101
87
-
However, if invoked like:
102
+
However, if invoked in the console like:
88
103
89
104
```shell
90
105
chk fetch request-someurl.chk
91
106
```
92
107
93
-
Then CHKware will replace `<% emailAddr %>` with something like `"user-2@domain.ext"` (or with an email of randomly picked number).
108
+
Then CHKware will replace `<% emailAddr %>` with something like `"user-2@domain.ext"` (or with an email of randomly picked number) since we set default value to `user-<% range(1, 5) | random %>@domain.ext`.
94
109
95
110
### Variable templating with Jinja2
96
111
97
-
For variable templating *CHKware* uses Jinja2. Almost all of the [Jinja2 features](https://jinja.palletsprojects.com/en/stable/templates/) are supported. That makes it possible to change variables values. e.g:
112
+
For variable templating _CHKware_ uses Jinja2. Almost all of the [Jinja2 features](https://jinja.palletsprojects.com/en/stable/templates/) are supported. That makes it possible to change variables values. e.g:
0 commit comments