Add options for resolvers and the api url
This commit is contained in:
parent
c512919fac
commit
2d9a070514
2 changed files with 24 additions and 17 deletions
|
|
@ -2,10 +2,17 @@ import click
|
|||
|
||||
from ip_listener.main import detect
|
||||
|
||||
DEFAULT_RESOLVERS = ["@resolver1.opendns.com", "@resolver2.opendns.com"]
|
||||
DEFAULT_API_URL = "https://api.transip.nl/v6"
|
||||
|
||||
|
||||
@click.command()
|
||||
@click.argument("domains", envvar="DOMAIN", nargs=-1)
|
||||
@click.argument("token", envvar="TOKEN")
|
||||
@click.option(
|
||||
"--resolvers", envvar="RESOLVERS", default=DEFAULT_RESOLVERS, multiple=True
|
||||
)
|
||||
@click.option("--api-url", envvar="API_URL", default=DEFAULT_API_URL)
|
||||
@click.option("--read-only/--write", envvar="READ_ONLY", default=False)
|
||||
def run(domains, token, read_only):
|
||||
detect(domains, token, read_only)
|
||||
def run(*args):
|
||||
detect(*args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue