# HG changeset patch # User Markus Mützel # Date 1655818300 -7200 # Node ID c415b218307faf967656f7cdf5654b50b27b01bb # Parent b47bf773c5084c285f02adf56defa942ca57fc2b inputParser: Correctly handle cell default values for optional parameters (bug #62639). * scripts/miscellaneous/inputParser.m (addOptional): Cell arrays as input for the `struct` function create a struct array. That is not the desired result here. Wrap cell input inside an additional cell to get the desired result. diff -r b47bf773c508 -r c415b218307f scripts/miscellaneous/inputParser.m --- a/scripts/miscellaneous/inputParser.m Mon Jun 20 19:31:21 2022 +0200 +++ b/scripts/miscellaneous/inputParser.m Tue Jun 21 15:31:40 2022 +0200 @@ -275,6 +275,9 @@ "after Parameter or Switch"]); endif this.validate_name ("Optional", name); + if (iscell (def)) + def = {def}; + endif this.Optional{end+1} = struct ("name", name, "def", def, "val", val); endfunction