blob: 638c3bdeb77d836b9a97df114850f9f00e8c8bc6 [file] [log] [blame]
John McCutchan93cf2ef2015-06-02 14:09:22 -07001#!/usr/bin/python
2# Copyright 2015 The Chromium Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6"""Recursively list files of the target directory. Ignores dot files."""
7
8import argparse
9import os
10import sys
11
12def main(target_directory):
13 for root, dirs, files in os.walk(target_directory):
14 files = [f for f in files if not f[0] == '.']
15 dirs[:] = [d for d in dirs if not d[0] == '.']
16 for f in files:
17 path = os.path.join(root, f)
18 print path
19
20if __name__ == '__main__':
21 parser = argparse.ArgumentParser(
22 description="Recursively list files of the target directory")
23 parser.add_argument("--target-directory",
24 dest="target_directory",
25 metavar="<target-directory>",
26 type=str,
27 required=True,
28 help="The target directory")
29
30 args = parser.parse_args()
31 sys.exit(main(args.target_directory))