Skip to content

Commit

Permalink
added macro to read Optional Args
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanho committed Nov 14, 2024
1 parent 03e5ceb commit 383032b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/ucar/unidata/idv/ui/ImageGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -3984,7 +3984,15 @@ private String applyMacros(String s, Hashtable props, boolean doTime) {
s = StringUtil.applyMacros(s, getStateManager().getProperties(),
false);
if (s.indexOf("${") >= 0) {
throw new BadIslException("Undefined macro in: " + s);
Hashtable optionArgs = getIdv().getArgsManager().getOptionalArgs();
if(optionArgs.size() > 0){
s = StringUtil.applyMacros(s, optionArgs,
false);
if(s.indexOf("${") >= 0) {
throw new BadIslException("Undefined macro in: " + s);
}
} else
throw new BadIslException("Undefined macro in: " + s);
}

if (s.startsWith("jython:")) {
Expand Down

0 comments on commit 383032b

Please sign in to comment.