Parameter¶
A named value a function needs. For example, the built-in
command function needs one parameter called command. You provide parameter
values on the button.
Some parameters are required; others are optional with a default defined in the function file.
Pass a value from a button¶
Write the parameter name as a key directly on the button. The built-in
command, path, and args fields follow this rule, and custom parameter
names work the same way.
Supply custom parameter names
unit and lines must be declared by journal-unit. The numeric value for
lines does not need quotes.
Do not use a nested params: map
A custom function file uses params: to declare its parameters. A button
does not. Put host:, unit:, or any other value directly on the button.
Validation¶
validate checks that:
- every required parameter has a value;
- every value on the button is declared by its function;
- values declared as
intcontain an integer; - values declared as
boolcontain a valid boolean; - defaults match the declared parameter type.
Optional parameters use their default when the button leaves them out.
Parameter names cannot be the same as button settings: name, type, icon,
id, function, confirm, timeout, workdir, env, columns, or
items. The names command, path, and args are allowed.
See Functions → Passing values from a button for the full explanation and examples.
Configuration¶
For button settings and parameter keys, see Configuration → Menu.