Allow whitelist/blacklist files to be passed via command line
authorAnthony Molinaro <redacted>
Mon, 13 Apr 2020 19:14:34 +0000 (12:14 -0700)
committerAnthony Molinaro <redacted>
Mon, 13 Apr 2020 19:14:34 +0000 (12:14 -0700)
readme_template.md
updateHostsFile.py

index fb449f913e1da39fdea911a6afbd1f39f1323b87..05118aa4a283732c025c907d2768e2bb0ce8358c 100644 (file)
@@ -146,6 +146,13 @@ each domain on a separate line. This is necessary because many implementations
 of URL blockers that rely on `hosts` files do not conform to the standard which
 allows multiple hosts on a single line.
 
+`--blacklist <blacklistfile>`, or `-x <blacklistfile>`: Append the given blacklist file
+in hosts format to the generated hosts file.
+
+`--whitelist <whitelistfile>`, or `-w <whitelistfile>`: Use the given whitelist file
+to remove hosts from the generated hosts file.
+
+
 ## How do I control which sources are unified?
 
 Add one or more *additional* sources, each in a subfolder of the `data/`
index 79d1deb9b63a608d92cab0f3653ef0d9f92283b5..9b190468c2875612a854009a4f2b3da2b5d4b714 100644 (file)
@@ -201,6 +201,20 @@ def main():
         "ignoring non-necessary lines "
         "(empty lines and comments).",
     )
+    parser.add_argument(
+        "--whitelist",
+        "-w",
+        dest="whitelistfile",
+        default="",
+        help="Whitelist file to use while generating hosts files.",
+    )
+    parser.add_argument(
+        "--blacklist",
+        "-x",
+        dest="blacklistfile",
+        default="",
+        help="Blacklist file to use while generating hosts files.",
+    )
 
     global settings
 
git clone https://git.99rst.org/PROJECT