chiark / gitweb /
all: deduplicate -v/-q setup
authorDaniel Martí <mvdan@mvdan.cc>
Sat, 12 Sep 2015 06:42:50 +0000 (23:42 -0700)
committerDaniel Martí <mvdan@mvdan.cc>
Sat, 12 Sep 2015 06:42:50 +0000 (23:42 -0700)
17 files changed:
fdroidserver/build.py
fdroidserver/checkupdates.py
fdroidserver/common.py
fdroidserver/gpgsign.py
fdroidserver/import.py
fdroidserver/init.py
fdroidserver/install.py
fdroidserver/lint.py
fdroidserver/publish.py
fdroidserver/readmeta.py
fdroidserver/rewritemeta.py
fdroidserver/scanner.py
fdroidserver/server.py
fdroidserver/signindex.py
fdroidserver/stats.py
fdroidserver/update.py
fdroidserver/verify.py

index 84734426831eb8ffa728feb1ad109d32c9b29743..23ed8c20ab85bcb7b072a1ba4e9da27a4cf0a72e 100644 (file)
@@ -935,11 +935,8 @@ def parse_commandline():
     """Parse the command line. Returns options, parser."""
 
     parser = ArgumentParser(usage="%(prog)s [options] [APPID[:VERCODE] [APPID[:VERCODE] ...]]")
+    common.setup_global_opts(parser)
     parser.add_argument("appid", nargs='*', help="app-id with optional versioncode in the form APPID[:VERCODE]")
-    parser.add_argument("-v", "--verbose", action="store_true", default=False,
-                        help="Spew out even more information than normal")
-    parser.add_argument("-q", "--quiet", action="store_true", default=False,
-                        help="Restrict output to warnings and errors")
     parser.add_argument("-l", "--latest", action="store_true", default=False,
                         help="Build only the latest version of each package")
     parser.add_argument("-s", "--stop", action="store_true", default=False,
index 786484103c1f39cc3db2fd060f985b03d2afe3ed..99db8bbc401c2785a7d2cfb85305546b1d27adf1 100644 (file)
@@ -527,11 +527,8 @@ def main():
 
     # Parse command line...
     parser = ArgumentParser(usage="%(prog)s [options] [APPID [APPID ...]]")
+    common.setup_global_opts(parser)
     parser.add_argument("appid", nargs='*', help="app-id to check for updates")
-    parser.add_argument("-v", "--verbose", action="store_true", default=False,
-                        help="Spew out even more information than normal")
-    parser.add_argument("-q", "--quiet", action="store_true", default=False,
-                        help="Restrict output to warnings and errors")
     parser.add_argument("--auto", action="store_true", default=False,
                         help="Process auto-updates")
     parser.add_argument("--autoonly", action="store_true", default=False,
index 3feaf07a54599e5d4eca9bf74cda1ec94a9470f6..becd35688c3122644bed69a20beb9773bfb4e134 100644 (file)
@@ -91,6 +91,13 @@ default_config = {
 }
 
 
+def setup_global_opts(parser):
+    parser.add_argument("-v", "--verbose", action="store_true", default=False,
+                        help="Spew out even more information than normal")
+    parser.add_argument("-q", "--quiet", action="store_true", default=False,
+                        help="Restrict output to warnings and errors")
+
+
 def fill_config_defaults(thisconfig):
     for k, v in default_config.items():
         if k not in thisconfig:
index 8fca41cd46ad125cf80dc38049be7d6966fd77e1..15c4deeb4353cb1eae0d4e4a4d8edf03ff6e5406 100644 (file)
@@ -36,10 +36,7 @@ def main():
 
     # Parse command line...
     parser = ArgumentParser(usage="%(prog)s [options]")
-    parser.add_argument("-v", "--verbose", action="store_true", default=False,
-                        help="Spew out even more information than normal")
-    parser.add_argument("-q", "--quiet", action="store_true", default=False,
-                        help="Restrict output to warnings and errors")
+    common.setup_global_opts(parser)
     options = parser.parse_args()
 
     config = common.read_config(options)
index 1debd2161a2e98f201075329f7a69a6f31163da0..eddb3238cc7bf4baf139a5cdfe66e8e3420ab63a 100644 (file)
@@ -158,10 +158,7 @@ def main():
 
     # Parse command line...
     parser = ArgumentParser()
-    parser.add_argument("-v", "--verbose", action="store_true", default=False,
-                        help="Spew out even more information than normal")
-    parser.add_argument("-q", "--quiet", action="store_true", default=False,
-                        help="Restrict output to warnings and errors")
+    common.setup_global_opts(parser)
     parser.add_argument("-u", "--url", default=None,
                         help="Project URL to import from.")
     parser.add_argument("-s", "--subdir", default=None,
index cf75b911d5391fd17bc3e3531ce727475ee55cd0..3474fba1685e8e446ad498080e430543aa073141 100644 (file)
@@ -51,10 +51,7 @@ def main():
 
     # Parse command line...
     parser = ArgumentParser()
-    parser.add_argument("-v", "--verbose", action="store_true", default=False,
-                        help="Spew out even more information than normal")
-    parser.add_argument("-q", "--quiet", action="store_true", default=False,
-                        help="Restrict output to warnings and errors")
+    common.setup_global_opts(parser)
     parser.add_argument("-d", "--distinguished-name", default=None,
                         help="X.509 'Distiguished Name' used when generating keys")
     parser.add_argument("--keystore", default=None,
index 5339319fb69b2bb60ca4a7b4460a967c102f8fc1..766cd6a0e586664e6516454be7ca7aadaa5424bc 100644 (file)
@@ -50,11 +50,8 @@ def main():
 
     # Parse command line...
     parser = ArgumentParser(usage="%(prog)s [options] [APPID[:VERCODE] [APPID[:VERCODE] ...]]")
+    common.setup_global_opts(parser)
     parser.add_argument("appid", nargs='*', help="app-id with optional versioncode in the form APPID[:VERCODE]")
-    parser.add_argument("-v", "--verbose", action="store_true", default=False,
-                        help="Spew out even more information than normal")
-    parser.add_argument("-q", "--quiet", action="store_true", default=False,
-                        help="Restrict output to warnings and errors")
     parser.add_argument("-a", "--all", action="store_true", default=False,
                         help="Install all signed applications available")
     options = parser.parse_args()
index 7291a407e77919b7ca8fbec35879e84440950da3..fb2ce2c0087ad10c25c20beeece93cb27138f259 100644 (file)
@@ -307,11 +307,8 @@ def main():
 
     # Parse command line...
     parser = ArgumentParser(usage="%(prog)s [options] [APPID [APPID ...]]")
+    common.setup_global_opts(parser)
     parser.add_argument("appid", nargs='*', help="app-id in the form APPID")
-    parser.add_argument("-v", "--verbose", action="store_true", default=False,
-                        help="Spew out even more information than normal")
-    parser.add_argument("-q", "--quiet", action="store_true", default=False,
-                        help="Restrict output to warnings and errors")
     options = parser.parse_args()
 
     config = common.read_config(options)
index 0ef5b60d63d04ad166523913ce3d24574a3e5b9d..74f162061254f87e20bf6128dfe00058560153b3 100644 (file)
@@ -41,11 +41,8 @@ def main():
     # Parse command line...
     parser = ArgumentParser(usage="%(prog)s [options] "
                             "[APPID[:VERCODE] [APPID[:VERCODE] ...]]")
+    common.setup_global_opts(parser)
     parser.add_argument("appid", nargs='*', help="app-id with optional versioncode in the form APPID[:VERCODE]")
-    parser.add_argument("-v", "--verbose", action="store_true", default=False,
-                        help="Spew out even more information than normal")
-    parser.add_argument("-q", "--quiet", action="store_true", default=False,
-                        help="Restrict output to warnings and errors")
     options = parser.parse_args()
 
     config = common.read_config(options)
index a01a358f315d89c0c8c482e9a6384954188c0320..f3fa12c035873c7b66e8ad84d58420372a0766d5 100644 (file)
@@ -25,10 +25,7 @@ import metadata
 def main():
 
     parser = ArgumentParser(usage="%(prog)s")
-    parser.add_argument("-v", "--verbose", action="store_true", default=False,
-                        help="Spew out even more information than normal")
-    parser.add_argument("-q", "--quiet", action="store_true", default=False,
-                        help="Restrict output to warnings and errors")
+    common.setup_global_opts(parser)
     parser.parse_args()
     common.read_config(None)
 
index 6c748f2b6ccf0f0e083adeeef8f78443165d9188..47e478a4a13546787200112e5e7befa95d6fadcb 100644 (file)
@@ -34,11 +34,8 @@ def main():
 
     # Parse command line...
     parser = ArgumentParser(usage="%(prog)s [options] [APPID [APPID ...]]")
+    common.setup_global_opts(parser)
     parser.add_argument("appid", nargs='*', help="app-id in the form APPID")
-    parser.add_argument("-v", "--verbose", action="store_true", default=False,
-                        help="Spew out even more information than normal")
-    parser.add_argument("-q", "--quiet", action="store_true", default=False,
-                        help="Restrict output to warnings and errors")
     options = parser.parse_args()
 
     config = common.read_config(options)
index fc15569b5eee4cb088199ec18c0be7e217067f67..15a25219a91ef0b9326e356c0e304276b54b6ba4 100644 (file)
@@ -250,11 +250,8 @@ def main():
 
     # Parse command line...
     parser = ArgumentParser(usage="%(prog)s [options] [APPID[:VERCODE] [APPID[:VERCODE] ...]]")
+    common.setup_global_opts(parser)
     parser.add_argument("appid", nargs='*', help="app-id with optional versioncode in the form APPID[:VERCODE]")
-    parser.add_argument("-v", "--verbose", action="store_true", default=False,
-                        help="Spew out even more information than normal")
-    parser.add_argument("-q", "--quiet", action="store_true", default=False,
-                        help="Restrict output to warnings and errors")
     options = parser.parse_args()
 
     config = common.read_config(options)
index 114e8a801076384187ac0f4eabd37a70c26142d2..802cac22588fa803df40f9dd28df74b04ea0db7f 100644 (file)
@@ -196,6 +196,7 @@ def main():
 
     # Parse command line...
     parser = ArgumentParser()
+    common.setup_global_opts(parser)
     parser.add_argument("command", help="command to execute, either 'init' or 'update'")
     parser.add_argument("-i", "--identity-file", default=None,
                         help="Specify an identity file to provide to SSH for rsyncing")
@@ -203,10 +204,6 @@ def main():
                         help="Specify a local folder to sync the repo to")
     parser.add_argument("--sync-from-local-copy-dir", action="store_true", default=False,
                         help="Before uploading to servers, sync from local copy dir")
-    parser.add_argument("-v", "--verbose", action="store_true", default=False,
-                        help="Spew out even more information than normal")
-    parser.add_argument("-q", "--quiet", action="store_true", default=False,
-                        help="Restrict output to warnings and errors")
     parser.add_argument("--no-checksum", action="store_true", default=False,
                         help="Don't use rsync checksums")
     options = parser.parse_args()
index e3645278f94729ed4c955e3b55bd3de3c688ff1c..9b571a20a4e61de0ec4fca4011b818464dc0b5ec 100644 (file)
@@ -35,10 +35,7 @@ def main():
 
     # Parse command line...
     parser = ArgumentParser(usage="%(prog)s [options]")
-    parser.add_argument("-v", "--verbose", action="store_true", default=False,
-                        help="Spew out even more information than normal")
-    parser.add_argument("-q", "--quiet", action="store_true", default=False,
-                        help="Restrict output to warnings and errors")
+    common.setup_global_opts(parser)
     options = parser.parse_args()
 
     config = common.read_config(options)
index a4f7cf162526204cac165c6568e36490af099e66..80b152c925d62b129c109d666e0ab51ce45616a1 100644 (file)
@@ -51,10 +51,7 @@ def main():
 
     # Parse command line...
     parser = ArgumentParser()
-    parser.add_argument("-v", "--verbose", action="store_true", default=False,
-                        help="Spew out even more information than normal")
-    parser.add_argument("-q", "--quiet", action="store_true", default=False,
-                        help="Restrict output to warnings and errors")
+    common.setup_global_opts(parser)
     parser.add_argument("-d", "--download", action="store_true", default=False,
                         help="Download logs we don't have")
     parser.add_argument("--recalc", action="store_true", default=False,
index c3fba05b808b198e75fba50c32803240f0f528e1..9d54b20e6e16f14151bdedd6d286901630e4ab24 100644 (file)
@@ -1049,16 +1049,13 @@ def main():
 
     # Parse command line...
     parser = ArgumentParser()
+    common.setup_global_opts(parser)
     parser.add_argument("--create-key", action="store_true", default=False,
                         help="Create a repo signing key in a keystore")
     parser.add_argument("-c", "--create-metadata", action="store_true", default=False,
                         help="Create skeleton metadata files that are missing")
     parser.add_argument("--delete-unknown", action="store_true", default=False,
                         help="Delete APKs without metadata from the repo")
-    parser.add_argument("-v", "--verbose", action="store_true", default=False,
-                        help="Spew out even more information than normal")
-    parser.add_argument("-q", "--quiet", action="store_true", default=False,
-                        help="Restrict output to warnings and errors")
     parser.add_argument("-b", "--buildreport", action="store_true", default=False,
                         help="Report on build data status")
     parser.add_argument("-i", "--interactive", default=False, action="store_true",
index 0e2f19621f5d506b334668dbf589a2ae65469db9..d8373eb035fc354c0cc46a4de7109dd28dceda6e 100644 (file)
@@ -37,11 +37,8 @@ def main():
 
     # Parse command line...
     parser = ArgumentParser(usage="%(prog)s [options] [APPID[:VERCODE] [APPID[:VERCODE] ...]]")
+    common.setup_global_opts(parser)
     parser.add_argument("appid", nargs='*', help="app-id with optional versioncode in the form APPID[:VERCODE]")
-    parser.add_argument("-v", "--verbose", action="store_true", default=False,
-                        help="Spew out even more information than normal")
-    parser.add_argument("-q", "--quiet", action="store_true", default=False,
-                        help="Restrict output to warnings and errors")
     options = parser.parse_args()
 
     config = common.read_config(options)