weegee: cli: clarify endpoint arguments to `interface connect`

This commit is contained in:
Shiz 2021-12-13 03:34:08 +01:00
parent 84cf47e0c8
commit d92ccb5b5f
1 changed files with 3 additions and 3 deletions

View File

@ -374,12 +374,12 @@ def main():
def do_connect_interface(parser: argparse.ArgumentParser, args: argparse.Namespace, ctx: WeegeeContext) -> None:
left_interface = WeegeeInterface.load(ctx, args.left)
left_peer = WeegeePeer.create(ctx, f'{args.left}-{args.right}', left_interface,
routes=args.left_route, host=args.left_host, port=args.left_port,
routes=args.left_route, host=args.left_endpoint, port=args.left_port,
)
left_peer.save()
right_interface = WeegeeInterface.load(ctx, args.right)
right_peer = WeegeePeer.create(ctx, f'{args.right}-{args.left}', right_interface,
routes=args.right_route, host=args.right_host, port=args.right_port,
routes=args.right_route, host=args.right_endpoint, port=args.right_port,
)
right_peer.save()
connection = WeegeeConnection.create(ctx, f'{args.left}-{args.right}', [left_peer, right_peer],
@ -390,7 +390,7 @@ def main():
connect_interface = interface_commands.add_parser('connect', help='connect two interfaces')
for i, (argname, helpname) in enumerate([('left', 'first'), ('right', 'second')]):
connect_interface.add_argument('-R' if i else '-r', f'--{argname}-route', metavar='ROUTE', type=ipaddress.ip_network, action='append', default=[], help=f'{helpname} interface route(s)')
connect_interface.add_argument('-E' if i else '-e', f'--{argname}-host', metavar='HOST', help=f'{helpname} interface endpoint (optional)')
connect_interface.add_argument('-E' if i else '-e', f'--{argname}-endpoint', metavar='HOST', help=f'{helpname} interface endpoint (optional)')
connect_interface.add_argument('-P' if i else '-p', f'--{argname}-port', metavar='PORT', type=int, help=f'{helpname} interface port (optional)')
connect_interface.add_argument('-k', '--preshared-key', metavar='KEY', help='preshared key (optional)')
connect_interface.add_argument('left', help='first interface')