Used Icinga-DSL for array-arg splitting

This commit is contained in:
Crited 2019-09-13 15:59:22 +02:00
parent ed803b739e
commit 2e960e3de9

View file

@ -211,7 +211,16 @@ function Get-IcingaCheckCommandConfig()
} elseif ($parameter.type.name -eq 'array') {
$Basket.Command[$Data.Syntax.syntaxItem.Name].arguments.Add(
[string]::Format('-{0}', $parameter.Name), @{
'value' = [string]::Format('(Split-IcingaCheckCommandArgs {0})', $IcingaCustomVariable);
'value' = @{
'type' = 'Function';
'body' = [string]::Format(
'var arr = macro("{0}");{1}if (len(arr) == 0) {2}{1}return "$null";{1}{3}{1}return arr.join(",");',
$IcingaCustomVariable,
"`r`n",
'{',
'}'
);
}
'order' = $Order;
}
);