mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 14:32:24 +00:00
36af9946c5
BUG= R=zra@google.com Review URL: https://codereview.chromium.org/2101243005 .
31 lines
1,013 B
Python
Executable file
31 lines
1,013 B
Python
Executable file
#!/usr/bin/python
|
|
# Copyright 2015 The Chromium Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
"""Recursively list files of the target directory. Ignores dot files."""
|
|
|
|
import argparse
|
|
import os
|
|
import sys
|
|
|
|
def main(target_directory):
|
|
for root, dirs, files in os.walk(target_directory):
|
|
files = [f for f in files if not f[0] == '.']
|
|
dirs[:] = [d for d in dirs if not d[0] == '.']
|
|
for f in files:
|
|
path = os.path.join(root, f)
|
|
print path
|
|
|
|
if __name__ == '__main__':
|
|
parser = argparse.ArgumentParser(
|
|
description="Recursively list files of the target directory")
|
|
parser.add_argument("--target-directory",
|
|
dest="target_directory",
|
|
metavar="<target-directory>",
|
|
type=str,
|
|
required=True,
|
|
help="The target directory")
|
|
|
|
args = parser.parse_args()
|
|
sys.exit(main(args.target_directory))
|