reporting: on error reading user options, print actual option passed not lowercase version of it
parent
d6210a4a34
commit
cbd43ee9df
|
@ -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
|
||||||
|
|
||||||
% 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
|
||||||
|
|
||||||
% 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
|
||||||
|
|
||||||
% 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
|
||||||
|
|
||||||
% 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
|
||||||
|
|
||||||
% 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
|
||||||
|
|
||||||
% 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
|
||||||
|
|
Loading…
Reference in New Issue