Fixed scripting around
This commit is contained in:
parent
dce35cb299
commit
aca5023c3f
12 changed files with 212 additions and 286 deletions
29
export.py
29
export.py
|
@ -19,15 +19,18 @@ if __name__ == '__main__':
|
|||
parser.add_argument(
|
||||
'-e', '--end-chain', action='store_true',
|
||||
help="TODO")
|
||||
parser.add_argument(
|
||||
'-x', '--explain', action='store_true',
|
||||
help="TODO")
|
||||
parser.add_argument(
|
||||
'-r', '--rules', action='store_true',
|
||||
help="TODO")
|
||||
parser.add_argument(
|
||||
'-b', '--base-rules', action='store_true',
|
||||
help="TODO implies rules")
|
||||
parser.add_argument(
|
||||
'-d', '--no-dupplicates', action='store_true',
|
||||
help="TODO")
|
||||
parser.add_argument(
|
||||
'-x', '--explain', action='store_true',
|
||||
help="TODO")
|
||||
parser.add_argument(
|
||||
'-c', '--count', action='store_true',
|
||||
help="TODO")
|
||||
|
@ -36,19 +39,21 @@ if __name__ == '__main__':
|
|||
DB = database.Database()
|
||||
|
||||
if args.count:
|
||||
assert not args.explain
|
||||
print(DB.count_records(
|
||||
first_party_only=args.first_party,
|
||||
rules_only=args.rules,
|
||||
no_dupplicates=args.no_dupplicates,
|
||||
))
|
||||
else:
|
||||
if args.rules:
|
||||
for line in DB.list_rules():
|
||||
print(line)
|
||||
for domain in DB.export(
|
||||
first_party_only=args.first_party,
|
||||
end_chain_only=args.end_chain,
|
||||
no_dupplicates=args.no_dupplicates,
|
||||
rules_only=args.base_rules,
|
||||
hostnames_only=not (args.rules or args.base_rules),
|
||||
))
|
||||
else:
|
||||
for domain in DB.list_records(
|
||||
first_party_only=args.first_party,
|
||||
end_chain_only=args.end_chain,
|
||||
no_dupplicates=args.no_dupplicates,
|
||||
rules_only=args.base_rules,
|
||||
hostnames_only=not (args.rules or args.base_rules),
|
||||
explain=args.explain,
|
||||
):
|
||||
print(domain, file=args.output)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue