in samcli/commands/local/generate_event/core/command.py [0:0]
def format_examples(ctx: Context, formatter: RootCommandHelpTextFormatter):
with formatter.indented_section(name="Examples", extra_indents=1):
with formatter.indented_section(name="Generate event S3 sends to local Lambda function", extra_indents=1):
formatter.write_rd(
[
RowDefinition(
text="\n",
),
RowDefinition(
name=style(f"${ctx.command_path} s3 [put/delete]"),
extra_row_modifiers=[ShowcaseRowModifier()],
),
]
)
with formatter.indented_section(name="Customize event by adding parameter flags.", extra_indents=1):
formatter.write_rd(
[
RowDefinition(
text="\n",
),
RowDefinition(
name=style(f"${ctx.command_path} s3 [put/delete] --help"),
extra_row_modifiers=[ShowcaseRowModifier()],
),
RowDefinition(
name=style(f"${ctx.command_path} s3 [put/delete] --bucket <bucket> --key <key>"),
extra_row_modifiers=[ShowcaseRowModifier()],
),
]
)
with formatter.indented_section(
name="Test generated event with serverless function locally!", extra_indents=1
):
formatter.write_rd(
[
RowDefinition(
text="\n",
),
RowDefinition(
name=style(
f"${ctx.command_path} s3 [put/delete] --bucket <bucket> --key <key> | "
f"{getattr(ctx.parent, 'command_path')} invoke -e -"
),
extra_row_modifiers=[ShowcaseRowModifier()],
),
]
)