add cmd -r to support scan dir recursively