Index: ensure_dependencies.py |
=================================================================== |
--- a/ensure_dependencies.py |
+++ b/ensure_dependencies.py |
@@ -9,16 +9,17 @@ import sys |
import os |
import posixpath |
import re |
import io |
import errno |
import logging |
import subprocess |
import urlparse |
+import argparse |
from collections import OrderedDict |
from ConfigParser import RawConfigParser |
USAGE = """ |
A dependencies file should look like this: |
# VCS-specific root URLs for the repositories |
@@ -273,13 +274,22 @@ def _ensure_line_exists(path, pattern): |
file_content.append(pattern) |
f.seek(0, os.SEEK_SET) |
f.truncate() |
for l in file_content: |
print >>f, l |
if __name__ == "__main__": |
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) |
- repos = sys.argv[1:] |
+ |
+ parser = argparse.ArgumentParser(description="Verify dependencies for a set of repositories, by default the repository of this script.") |
+ parser.add_argument("repos", metavar="repository", type=str, nargs="*", help="Repository path") |
+ parser.add_argument("-q", "--quiet", action="store_true", help="Suppress informational output") |
+ args = parser.parse_args() |
+ |
+ if args.quiet: |
+ logging.disable(logging.INFO) |
+ |
+ repos = args.repos |
if not len(repos): |
repos = [os.path.dirname(__file__)] |
for repo in repos: |
resolve_deps(repo) |