in samcli/commands/local/cli_common/options.py [0:0]
def local_common_options(f):
"""
Common CLI options shared by "local invoke", "local start-api", and "local start-lambda" commands
:param f: Callback passed by Click
"""
local_options = [
click.option(
"--shutdown",
is_flag=True,
default=False,
help="Emulate a shutdown event after invoke completes, " "to test extension handling of shutdown behavior.",
),
click.option(
"--container-host",
default="localhost",
show_default=True,
help="Host of locally emulated Lambda container. "
"This option is useful when the container runs on a different host than AWS SAM CLI. "
"For example, if one wants to run AWS SAM CLI in a Docker container on macOS, "
"this option could specify `host.docker.internal`",
),
click.option(
"--container-host-interface",
default=DEFAULT_CONTAINER_HOST_INTERFACE,
show_default=True,
help="IP address of the host network interface that container ports should bind to. "
"Use 0.0.0.0 to bind to all interfaces.",
),
click.option(
"--add-host",
multiple=True,
type=DockerAdditionalHostType(),
callback=local_add_host_callback,
required=False,
help="Passes a hostname to IP address mapping to the Docker container's host file. "
"This parameter can be passed multiple times."
""
"Example:"
"--add-host example.com:127.0.0.1",
),
click.option(
"--invoke-image",
"-ii",
default=None,
required=False,
multiple=True,
help="Container image URIs for invoking functions or starting api and function. "
"One can specify the image URI used for the local function invocation "
"(--invoke-image public.ecr.aws/sam/build-nodejs20.x:latest). "
"One can also specify for each individual function with "
"(--invoke-image Function1=public.ecr.aws/sam/build-nodejs20.x:latest). "
"If a function does not have invoke image specified, the default AWS SAM CLI "
"emulation image will be used.",
),
click.option(
"--no-memory-limit",
default=False,
is_flag=True,
help="Removes the Memory limit during emulation. "
"With this parameter, the underlying container will run without a --memory parameter",
),
]
# Reverse the list to maintain ordering of options in help text printed with --help
for option in reversed(local_options):
option(f)
return f