From e1c4eb1ade54eaa48f2c1c574407b0673a3bdb4f Mon Sep 17 00:00:00 2001 From: Martijn Braam Date: Mon, 11 Oct 2021 03:45:34 +0200 Subject: [PATCH] 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 --- ssh.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ssh.py b/ssh.py index be5c25e..2df50ee 100644 --- a/ssh.py +++ b/ssh.py @@ -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}', ])