ssh: add --user and --host argument

Extra arguments to allow quickly overriding the username and ip address
for the ssh call. Just in case you're connecting over wifi instead of
172.16.42.1
This commit is contained in:
Martijn Braam 2021-10-11 03:45:34 +02:00 committed by Caleb Connolly
parent ebdd8bf111
commit e1c4eb1ade
No known key found for this signature in database
GPG key ID: 0583312B195F64B6

6
ssh.py
View file

@ -4,8 +4,10 @@ from logger import setup_logging, verbose_option
@click.command(name='ssh')
@click.option('--user', prompt='The SSH username', default='kupfer')
@click.option('--host', prompt='The SSH host', default='172.16.42.1')
@verbose_option
def cmd_ssh(verbose):
def cmd_ssh(verbose, user, host):
setup_logging(verbose)
subprocess.run([
@ -16,5 +18,5 @@ def cmd_ssh(verbose):
'UserKnownHostsFile=/dev/null',
'-o',
'StrictHostKeyChecking=no',
'kupfer@172.16.42.1',
f'{user}@{host}',
])