mirror of
https://github.com/StevenBlack/hosts.git
synced 2024-06-30 17:45:52 +02:00
Allow whitelist/blacklist files to be passed via command line
This commit is contained in:
parent
a2ab99d9b1
commit
dd2d878e95
|
@ -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
|
of URL blockers that rely on `hosts` files do not conform to the standard which
|
||||||
allows multiple hosts on a single line.
|
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?
|
## How do I control which sources are unified?
|
||||||
|
|
||||||
Add one or more *additional* sources, each in a subfolder of the `data/`
|
Add one or more *additional* sources, each in a subfolder of the `data/`
|
||||||
|
|
|
@ -201,6 +201,20 @@ def main():
|
||||||
"ignoring non-necessary lines "
|
"ignoring non-necessary lines "
|
||||||
"(empty lines and comments).",
|
"(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
|
global settings
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user