X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=bin%2Ffind_file_paths;h=47618281d5deba2817494f237cbb3419e4ca6ece;hb=d797c850a8493c0027b1e8b8dbc4d3e78840d4d9;hp=cf4d9c51260d30d69785f1cbfe1662459e357f03;hpb=cc7b42ff1571d8b79e503a4016c2402b30836188;p=dead%2Fcensus-tools.git diff --git a/bin/find_file_paths b/bin/find_file_paths index cf4d9c5..4761828 100755 --- a/bin/find_file_paths +++ b/bin/find_file_paths @@ -63,25 +63,9 @@ if len(args) < 1: raise SystemExit(ExitCodes.NOT_ENOUGH_ARGS) -found_paths = [] - -# Build a list of found paths, in case there are / we want more than -# one. -for filename in args: - # If --single was passed, we relay it to the find_file_paths - # function so that it completes sooner (it doesn't have to keep - # looking after the first match). - found_paths += FileUtils.find_file_paths(options.root, - filename, - options.single) - - if options.single and (len(found_paths) > 0): - # If we found anything and we only want the first match, just - # print it and quit. - print found_paths[0] - raise SystemExit(ExitCodes.EXIT_SUCCESS) - - -# If we weren't passed --single, spit out all matches. +found_paths = FileUtils.find_file_paths(options.root, + args, + options.single) + for fp in found_paths: print fp