Allow whitelist/blacklist files to be passed via command line

This commit is contained in:
Anthony Molinaro 2020-04-13 12:14:34 -07:00
parent a2ab99d9b1
commit dd2d878e95
2 changed files with 21 additions and 0 deletions

View 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/`

View 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