Mercurial > hg
changeset 31824:4804644489cf
check-code: use "-" to specify a list of files from stdin
This will be used by the next patch.
author | Jun Wu <quark@fb.com> |
---|---|
date | Thu, 06 Apr 2017 22:08:23 -0700 |
parents | f6d77af84ef3 |
children | 6c7a58d3ca5d |
files | contrib/check-code.py |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/check-code.py Thu Apr 06 14:41:42 2017 +0200 +++ b/contrib/check-code.py Thu Apr 06 22:08:23 2017 -0700 @@ -673,7 +673,7 @@ return result def main(): - parser = optparse.OptionParser("%prog [options] [files]") + parser = optparse.OptionParser("%prog [options] [files | -]") parser.add_option("-w", "--warnings", action="store_true", help="include warning-level checks") parser.add_option("-p", "--per-file", type="int", @@ -691,6 +691,9 @@ if len(args) == 0: check = glob.glob("*") + elif args == ['-']: + # read file list from stdin + check = sys.stdin.read().splitlines() else: check = args