From 9796e53f32655b1923e5e02749ab6e167b4d0f66 Mon Sep 17 00:00:00 2001 From: Sangwhan Moon Date: Wed, 17 Mar 2021 15:44:25 +0900 Subject: [PATCH] Add option to allow command execution. --- geofrontcli/cli.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/geofrontcli/cli.py b/geofrontcli/cli.py index 62ad831..eb48bd3 100644 --- a/geofrontcli/cli.py +++ b/geofrontcli/cli.py @@ -331,7 +331,11 @@ def ssh(args, alias=None): ssh.error(str(e)) if args.jump_host: options.extend(['-o', 'ProxyJump=={}'.format(args.jump_host)]) - subprocess.call([args.ssh] + options) + + if args.exec: + subprocess.call([args.ssh] + options + [args.exec]) + else: + subprocess.call([args.ssh] + options) ssh.add_argument('remote', help='the remote alias to ssh') @@ -419,6 +423,11 @@ def go(args): help='do not open the authentication web page using browser. ' 'instead print the url to open' ) + p.add_argument( + '-X', '--exec', + default=None, + help='Command to run' + ) p.add_argument( '-J', '--jump-host', default=None,