Skip to content

Commit 1e83a7d

Browse files
committed
add port argument to cli
add argument to disable ssl-verification
1 parent 07ac65e commit 1e83a7d

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

pyfritzhome/cli.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22
"""A simple CLI tool."""
3+
34
# -*- coding: utf-8 -*-
45

56
from __future__ import print_function
@@ -209,8 +210,15 @@ def main(args=None):
209210
help="Fritz!Box IP address",
210211
default="fritz.box",
211212
)
213+
parser.add_argument("--port", type=int, dest="port", help="Port")
214+
parser.add_argument(
215+
"--insecure",
216+
action="store_true",
217+
dest="insecure",
218+
help="Don't verify SSL certificates",
219+
)
212220
parser.add_argument("-u", "--user", type=str, dest="user", help="Username")
213-
parser.add_argument("-p", "--password", type=str, dest="password", help="Username")
221+
parser.add_argument("-p", "--password", type=str, dest="password", help="Password")
214222
parser.add_argument(
215223
"-a",
216224
"--ain",
@@ -385,7 +393,13 @@ def main(args=None):
385393

386394
fritzbox = None
387395
try:
388-
fritzbox = Fritzhome(host=args.host, user=args.user, password=args.password)
396+
fritzbox = Fritzhome(
397+
host=args.host,
398+
user=args.user,
399+
password=args.password,
400+
port=args.port or None,
401+
ssl_verify=not args.insecure,
402+
)
389403
fritzbox.login()
390404
args.func(fritzbox, args)
391405
finally:

0 commit comments

Comments
 (0)