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
Users may define macros for `zti`. When defined, user macros appear in the list of available commands for `zti`. User macros are created by placing Python files in the ZTI macros directory, which defaults to the path `~/.zti-mac`. This path may be overridden with the `ZTI_MACROS_DIR` environment variables.
6
+
7
+
User macro file names must take the form `my_macro.py`, and must contain a function with the signature,
8
+
9
+
```python
10
+
defdo_my_macro(zti, arg):
11
+
...
12
+
```
13
+
14
+
This function is invoked when the macro command is run from `zti`. It is passed the current `zti` instance as the first argument and any arguments to the command as the second argument.
15
+
16
+
The macro file may optionally also contain a function with the signature,
17
+
18
+
```python
19
+
defhelp_my_macro(zti):
20
+
...
21
+
```
22
+
23
+
This function will be registered as the help command for the main macro command.
24
+
25
+
See `examples/macros/logon.py` for an example of a user macro.
26
+
27
+
A macro file name may not contain more than one period character. User macros which conflict with existing ZTI commands are ignored.
0 commit comments