You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: getOptions.m
    path of file: ./repos/ciatah/+ciapkg/+io
    
    the code of the file until where you have to start completion: function [options] = getOptions(options,inputArgs,varargin)
	% [options] = getOptions(options,inputArgs,varargin)
	%
	% Gets default options for a function and replaces them with 
    
function [toStruct] = mirrorRightStruct(fromStruct,toStruct,goptions,toStructName)
	% Overwrites fields in toStruct with those in fromStruct, other toStruct fields remain intact.
	% More generally, copies fields in fromStruct into toStruct, if there is an overlap in field names, fromStruct overwrites.
	% Fields present in toStruct but not fromStruct are kept in toStruct output.
	fromNames = fieldnames(fromStruct);
	for name = 1:length(fromNames)
		fromField = fromNames{name};
		% if a field name is a struct, recursively grab user options from it
		if isfield(toStruct, fromField)|isprop(toStruct, fromField)
			if isstruct(fromStruct.(fromField))&goptions.recursiveStructs==1
				% safety check: field exist in toStruct and is also a structure
				if isstruct(toStruct.(fromField))
					toStruct.(fromField) = mirrorRightStruct(fromStruct.(fromField),toStruct.(fromField),goptions,[toStructName '.' fromField]);
				else
					if goptions.showWarnings==1
						localShowWarnings(3,'notstruct',toStructName,fromField,'',goptions.nParentStacks);
					end