function [flags, groups] = getArchiveFlags(h, varargin)
% GETARCHIVEFLAGS The getArchiveFlags function returns archive options stored
% in the model's build information. Using optional includeGroups and
% excludeGroups arguments, you can selectively include or exclude groups of
% options the function returns.
%
% Argument      description
% buildinfo     Build information handle returned by RTW.Buildinfo.
% 
% includeGroups (optional) A character array or cell array of character arrays
%               that specifies groups of archive flags you want the function
%               to return. 
%
% excludeGroups (optional) A character array or cell array of character arrays
%               that specifies groups of archive flags you do not want the
%               function to return.
%
% Return values
% the function returns the archive options stored in the model's build
% information.
%
% example 1:   
%   myModelBuildInfo = RTW.BuildInfo;
%   addArchiveFlags(myModelBuildInfo, {{'-MD -Gy' '-T'},... 
%                   {'Debug' 'MemOpt'});
%   compflags=getArchiveFlags(myModelBuildInfo);
%
%   resulting values:
%   compflags == {{'-MD -Gy' '-T'}
%
% example 2:
%   myModelBuildInfo = RTW.BuildInfo;
%   addArchiveFlags(myModelBuildInfo, {{'-MD -Gy' '-T'}, {'Debug' 'MemOpt'});
%   compflags=getArchiveFlags(myModelBuildInfo, '', 'Debug');
%
%   resulting values:
%   compflags == {'-T'}
%
% Please refer to the documentation for more information.
%

% Copyright 2012-2020 The MathWorks, Inc.

[flags, ~, ~, groups] = h.Options.getOptions('ArchiveFlags',varargin{:});
