mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 22:18:20 +00:00
Add documentation of "option" declarations
This commit is contained in:
parent
f3e42874b8
commit
79afd99229
1 changed files with 22 additions and 0 deletions
|
@ -20,6 +20,9 @@ Declarations
|
|||
+----------------------------+-----------------------------+
|
||||
| :bro:keyword:`const` | Declare a constant |
|
||||
+----------------------------+-----------------------------+
|
||||
| :bro:keyword:`option` | Declare a configuration |
|
||||
| | option |
|
||||
+----------------------------+-----------------------------+
|
||||
| :bro:keyword:`type` | Declare a user-defined type |
|
||||
+----------------------------+-----------------------------+
|
||||
| :bro:keyword:`redef` | Redefine a global value or |
|
||||
|
@ -176,6 +179,25 @@ all loaded Bro scripts.
|
|||
or "global" keywords (i.e., "const" replaces "local" and "global").
|
||||
|
||||
|
||||
.. bro:keyword:: option
|
||||
|
||||
A variable declared with the "option" keyword is a configuration option.
|
||||
|
||||
Options are required to be initialized at the
|
||||
time of declaration. Normally, the type is inferred from the initializer,
|
||||
but the type can be explicitly specified. Example::
|
||||
|
||||
option hostname = "host-1";
|
||||
option peers: set[addr] = {};
|
||||
|
||||
The value of an option cannot be changed by an assignment statement.
|
||||
|
||||
The scope of an option is global.
|
||||
|
||||
Note that an "option" declaration cannot also use the "local", "global",
|
||||
or "const" keywords.
|
||||
|
||||
|
||||
.. bro:keyword:: type
|
||||
|
||||
The "type" keyword is used to declare a user-defined type. The name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue