mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-08-17 16:21:15 +02:00
mod/inspectvar: truncate value if too long
This commit is contained in:
parent
b872615e89
commit
004621a327
1 changed files with 3 additions and 1 deletions
|
@ -19,6 +19,7 @@
|
||||||
:local Input $1;
|
:local Input $1;
|
||||||
:local Level (0 + [ :tonum $2 ]);
|
:local Level (0 + [ :tonum $2 ]);
|
||||||
|
|
||||||
|
:global IfThenElse;
|
||||||
:global InspectVarReturn;
|
:global InspectVarReturn;
|
||||||
|
|
||||||
:local IndentReturn do={
|
:local IndentReturn do={
|
||||||
|
@ -45,7 +46,8 @@
|
||||||
} else={
|
} else={
|
||||||
:if ($TypeOf != "nothing") do={
|
:if ($TypeOf != "nothing") do={
|
||||||
:set $Return ($Return . "\n" . \
|
:set $Return ($Return . "\n" . \
|
||||||
[ $IndentReturn "value" $Input $Level ]);
|
[ $IndentReturn "value" [ $IfThenElse ([ :len $Input ] > 80) \
|
||||||
|
([ :pick $Input 0 77 ] . "...") $Input ] $Level ]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
:return $Return;
|
:return $Return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue