def Args(parser): iap_tunnel.AddProxyServerHelperArgs(parser) flags.INSTANCE_ARG.AddArgument(parser) parser.add_argument( 'instance_port', type=arg_parsers.BoundedInt(lower_bound=1, upper_bound=65535), help="The name or number of the instance's port to connect to.") local_host_port_help_text = """\ `LOCAL_HOST:LOCAL_PORT` on which gcloud should bind and listen for connections that should be tunneled. `LOCAL_PORT` may be omitted, in which case it is treated as 0 and an arbitrary unused local port is chosen. The colon also may be omitted in that case. If `LOCAL_PORT` is 0, an arbitrary unused local port is chosen.""" parser.add_argument('--local-host-port', type=lambda arg: arg_parsers.HostPort.Parse( arg, ipv6_enabled=True), default='localhost:0', help=local_host_port_help_text) # It would be logical to put --local-host-port and --listen-on-stdin in a # mutex group, but then the help text would display a message saying "At # most one of these may be specified" even though it only shows # --local-host-port. parser.add_argument( '--listen-on-stdin', action='store_true', hidden=True, help=( 'Whether to get/put local data on stdin/stdout instead of ' 'listening on a socket. It is an error to specify ' '--local-host-port with this, because that flag has no meaning ' 'with this.'))
def Args(parser): iap_tunnel.AddProxyServerHelperArgs(parser) flags.INSTANCE_ARG.AddArgument(parser) parser.add_argument( 'instance_port', type=arg_parsers.BoundedInt(lower_bound=1, upper_bound=65535), help="The name or number of the instance's port to connect to.") parser.add_argument( '--local-host-port', type=lambda arg: arg_parsers.HostPort.Parse(arg, ipv6_enabled=True ), default='localhost:0', help='Host:port to which the proxy should be bound.') # It would be logical to put --local-host-port and --listen-on-stdin in a # mutex group, but then the help text would display a message saying "At # most one of these may be specified" even though it only shows # --local-host-port. parser.add_argument( '--listen-on-stdin', action='store_true', hidden=True, help=( 'Whether to get/put local data on stdin/stdout instead of ' 'listening on a socket. It is an error to specify ' '--local-host-port with this, because that flag has no meaning ' 'with this.')) parser.add_argument( '--network-interface', default='nic0', help= ('Specifies the name of the instance network interface to connect ' 'to. If this is not provided, then "nic0" is used as the ' 'default.'))
def Args(parser): iap_tunnel.AddProxyServerHelperArgs(parser) flags.INSTANCE_ARG.AddArgument(parser) parser.add_argument( 'instance_port', type=arg_parsers.BoundedInt(lower_bound=1, upper_bound=65535), help="The name or number of the instance's port to connect to.") parser.add_argument( '--local-host-port', type=lambda arg: arg_parsers.HostPort.Parse(arg, ipv6_enabled=True), default='localhost:0', help='Host:port to which the proxy should be bound.') parser.add_argument( '--network-interface', default='nic0', help=('Specifies the name of the instance network interface to connect ' 'to. If this is not provided, then "nic0" is used as the ' 'default.'))