function out = packageBuilderArgs(h,options)

%   Copyright 2014 The MathWorks, Inc.

out = [  ];
% Ensure default value is set
out.compileErrorDiagnosticFcns = {  };
if mod( numel( options ), 2 )~=0
    error( message( 'CoderFoundation:utility:InvalidPropertyValuePairs' ) );
end
props = options( 1:2:end );
values = options( 2:2:end );
if ~iscell( props )  %% ~iscellstr(props)
    error( message( 'CoderFoundation:utility:InvalidPropertyFormat' ) );
end
for i = 1:numel( props )
    % TODO in BTIv2: Perform individual tests when the specific
    % fields become known to us
    % TODO in BTIv2: Set default value whenever necessary
    out.(props{ i }) = values{ i };
end
end
