Menu

#2804 vap macro feature is barely described

nextrelease
open
nobody
None
5
10 hours ago
10 hours ago
No

You can have any macro in a .vap file, not just PWD. This is a feature that has always been in there, as long as PWD has been in use, but the feature is not described. Ivar's asked to have a file parameter in vaps, and this would work nicely for that, and Darrelle has a timestamp at the bottom of plots she generates.

If a .vap contains %{TODAY} in a string, and the .vap is loaded with .../file.vap?TODAY=2026-02-28, then the macro is replaced.

Looking at the code there are TODOs because only on instance of the macro is replaced per string, and also I think there are security concerns. For example, any text could be replaced using the DomUtil.applyMacro, where it assumes the macro looks like "%{TODAY}". Now it verifies that the search text starts with "%{" and ends with "}".

Discussion

  • Jeremy Faden

    Jeremy Faden - 10 hours ago

    It would also be nice to have regular expression constraints on macros. This should be done in a consistent way with constraints in script parameters.

     

    Last edit: Jeremy Faden 10 hours ago
MongoDB Logo MongoDB