add ‘recursive’ option to prevent search descending into subdirectories

what is the purpose of this?