From 8909b381078415a14695f1d2f66a5413eb89b5f5 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Sat, 20 Feb 2016 18:24:14 +0200 Subject: [PATCH] main: use command-line for git interaction --- trezor_agent/__main__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/trezor_agent/__main__.py b/trezor_agent/__main__.py index 31ad406..e3c4a55 100644 --- a/trezor_agent/__main__.py +++ b/trezor_agent/__main__.py @@ -39,6 +39,8 @@ def create_agent_parser(): help='run ${SHELL} as subprocess under SSH agent') g.add_argument('-c', '--connect', default=False, action='store_true', help='connect to specified host via SSH') + g.add_argument('-g', '--git', default=False, action='store_true', + help='run git using specified identity as remote name') curve_names = [name.decode('ascii') for name in formats.SUPPORTED_CURVES] curve_names = ', '.join(sorted(curve_names)) p.add_argument('-e', '--ecdsa-curve-name', metavar='CURVE', @@ -92,11 +94,11 @@ def run_agent(client_factory): label = args.identity command = args.command - if label == 'git': - label = git_host('origin') + if args.git: + label = git_host(remote_name=label) log.debug('Git identity: %r', label) - if args.command: - command = ['git'] + args.command + if command: + command = ['git'] + command log.debug('Git command: %r', command) public_key = conn.get_public_key(label=label)