Commit cbd43ee9 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

reporting: on error reading user options, print actual option passed not lowercase version of it

parent d6210a4a
...@@ -77,13 +77,12 @@ elseif nargin > 1 ...@@ -77,13 +77,12 @@ elseif nargin > 1
% overwrite default values % overwrite default values
for pair = reshape(varargin, 2, []) for pair = reshape(varargin, 2, [])
field = lower(pair{1}); ind = strmatch(lower(pair{1}), lower(optNames), 'exact');
ind = strmatch(field, lower(optNames), 'exact');
assert(isempty(ind) || length(ind) == 1); assert(isempty(ind) || length(ind) == 1);
if ~isempty(ind) if ~isempty(ind)
o.(optNames{ind}) = pair{2}; o.(optNames{ind}) = pair{2};
else else
error('@graph.graph: %s is not a recognized option.', field); error('@graph.graph: %s is not a recognized option.', pair{1});
end end
end end
end end
......
...@@ -52,13 +52,12 @@ elseif nargin > 1 ...@@ -52,13 +52,12 @@ elseif nargin > 1
% overwrite default values % overwrite default values
for pair = reshape(varargin, 2, []) for pair = reshape(varargin, 2, [])
field = lower(pair{1}); ind = strmatch(lower(pair{1}), lower(optNames), 'exact');
ind = strmatch(field, lower(optNames), 'exact');
assert(isempty(ind) || length(ind) == 1); assert(isempty(ind) || length(ind) == 1);
if ~isempty(ind) if ~isempty(ind)
o.(optNames{ind}) = pair{2}; o.(optNames{ind}) = pair{2};
else else
error('@page.page: %s is not a recognized option.', field); error('@page.page: %s is not a recognized option.', pair{1});
end end
end end
end end
......
...@@ -58,14 +58,12 @@ elseif nargin > 1 ...@@ -58,14 +58,12 @@ elseif nargin > 1
% overwrite default values % overwrite default values
for pair = reshape(varargin, 2, []) for pair = reshape(varargin, 2, [])
field = lower(pair{1}); ind = strmatch(lower(pair{1}), lower(optNames), 'exact');
ind = strmatch(field, lower(optNames), 'exact');
assert(isempty(ind) || length(ind) == 1); assert(isempty(ind) || length(ind) == 1);
if ~isempty(ind) if ~isempty(ind)
o.(optNames{ind}) = pair{2}; o.(optNames{ind}) = pair{2};
else else
error('@report.report: %s is not a recognized option.', ... error('@report.report: %s is not a recognized option.', pair{1});
field);
end end
end end
end end
......
...@@ -40,14 +40,12 @@ elseif nargin > 1 ...@@ -40,14 +40,12 @@ elseif nargin > 1
% overwrite default values % overwrite default values
for pair = reshape(varargin, 2, []) for pair = reshape(varargin, 2, [])
field = lower(pair{1}); ind = strmatch(lower(pair{1}), lower(optNames), 'exact');
ind = strmatch(field, lower(optNames), 'exact');
assert(isempty(ind) || length(ind) == 1); assert(isempty(ind) || length(ind) == 1);
if ~isempty(ind) if ~isempty(ind)
o.(optNames{ind}) = pair{2}; o.(optNames{ind}) = pair{2};
else else
error('@section.section: %s is not a recognized option.', ... error('@section.section: %s is not a recognized option.', pair{1});
field);
end end
end end
end end
......
...@@ -65,13 +65,12 @@ elseif nargin > 1 ...@@ -65,13 +65,12 @@ elseif nargin > 1
% overwrite default values % overwrite default values
for pair = reshape(varargin, 2, []) for pair = reshape(varargin, 2, [])
field = lower(pair{1}); ind = strmatch(lower(pair{1}), lower(optNames), 'exact');
ind = strmatch(field, lower(optNames), 'exact');
assert(isempty(ind) || length(ind) == 1); assert(isempty(ind) || length(ind) == 1);
if ~isempty(ind) if ~isempty(ind)
o.(optNames{ind}) = pair{2}; o.(optNames{ind}) = pair{2};
else else
error('@series.series: %s is not a recognized option.', field); error('@series.series: %s is not a recognized option.', pair{1});
end end
end end
end end
......
...@@ -62,14 +62,12 @@ elseif nargin > 1 ...@@ -62,14 +62,12 @@ elseif nargin > 1
% overwrite default values % overwrite default values
for pair = reshape(varargin, 2, []) for pair = reshape(varargin, 2, [])
field = lower(pair{1}); ind = strmatch(lower(pair{1}), lower(optNames), 'exact');
ind = strmatch(field, lower(optNames), 'exact');
assert(isempty(ind) || length(ind) == 1); assert(isempty(ind) || length(ind) == 1);
if ~isempty(ind) if ~isempty(ind)
o.(optNames{ind}) = pair{2}; o.(optNames{ind}) = pair{2};
else else
error('%s is not a recognized option to the Table constructor.', ... error('%s is not a recognized option to the Table constructor.', pair{1});
field);
end end
end end
end end
......
...@@ -48,13 +48,12 @@ elseif nargin > 1 ...@@ -48,13 +48,12 @@ elseif nargin > 1
% overwrite default values % overwrite default values
for pair = reshape(varargin, 2, []) for pair = reshape(varargin, 2, [])
field = lower(pair{1}); ind = strmatch(lower(pair{1}), lower(optNames), 'exact');
ind = strmatch(field, lower(optNames), 'exact');
assert(isempty(ind) || length(ind) == 1); assert(isempty(ind) || length(ind) == 1);
if ~isempty(ind) if ~isempty(ind)
o.(optNames{ind}) = pair{2}; o.(optNames{ind}) = pair{2};
else else
error('@vspace.vspace: %s is not a recognized option.', field); error('@vspace.vspace: %s is not a recognized option.', pair{1});
end end
end end
end end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment