WIP: Improve config parsing, make --verbose and --config-file global options

Bonus: Generalize and reuse cmd_ssh()

Signed-off-by: InsanePrawn <insane.prawny@gmail.com>
This commit is contained in:
InsanePrawn 2021-09-09 20:23:23 +02:00
parent 4cf608eeb6
commit 144acee10f
12 changed files with 122 additions and 104 deletions

View file

@ -1,14 +1,10 @@
import subprocess
import click
from logger import setup_logging, verbose_option
@click.command(name='telnet')
@verbose_option
def cmd_telnet(verbose):
setup_logging(verbose)
def cmd_telnet(hostname: str = '172.16.42.1'):
subprocess.run([
'telnet',
'172.16.42.1',
hostname,
])