MCPcopy Create free account
hub / github.com/aws/aws-sam-cli / format_examples

Method format_examples

samcli/commands/deploy/core/command.py:23–72  ·  view source on GitHub ↗
(ctx: Context, formatter: CommandHelpTextFormatter)

Source from the content-addressed store, hash-verified

21
22 @staticmethod
23 def format_examples(ctx: Context, formatter: CommandHelpTextFormatter):
24 with formatter.indented_section(name="Examples", extra_indents=1):
25 with formatter.indented_section(name="Deploy with guided prompts", extra_indents=1):
26 formatter.write_text_rows(
27 [
28 RowDefinition(
29 name=style(f"$ {ctx.command_path} --guided"),
30 extra_row_modifiers=[ShowcaseRowModifier()],
31 ),
32 ]
33 )
34 with formatter.indented_section(name="Deploy with specified parameters", extra_indents=1):
35 formatter.write_text_rows(
36 [
37 RowDefinition(
38 name=style(
39 f"$ {ctx.command_path} --template-file packaged.yaml --stack-name "
40 f"sam-app --capabilities CAPABILITY_IAM"
41 ),
42 extra_row_modifiers=[ShowcaseRowModifier()],
43 ),
44 ]
45 )
46 with formatter.indented_section(
47 name="Deploy with parameter overrides using CloudFormation syntax", extra_indents=1
48 ):
49 formatter.write_text_rows(
50 [
51 RowDefinition(
52 name=style(
53 f"$ {ctx.command_path} --parameter-overrides "
54 f"'ParameterKey=InstanceType,ParameterValue=t1.micro'"
55 ),
56 extra_row_modifiers=[ShowcaseRowModifier()],
57 ),
58 ]
59 )
60 with formatter.indented_section(
61 name="Deploy with parameter overrides using shorthand syntax", extra_indents=1
62 ):
63 formatter.write_text_rows(
64 [
65 RowDefinition(
66 name=style(
67 f"$ {ctx.command_path} --parameter-overrides KeyPairName=MyKey InstanceType=t1.micro"
68 ),
69 extra_row_modifiers=[ShowcaseRowModifier()],
70 ),
71 ]
72 )
73
74 @staticmethod
75 def format_acronyms(formatter: CommandHelpTextFormatter):

Callers 1

format_optionsMethod · 0.45

Calls 4

RowDefinitionClass · 0.90
ShowcaseRowModifierClass · 0.90
indented_sectionMethod · 0.45
write_text_rowsMethod · 0.45

Tested by

no test coverage detected