Skip to content

Commit c646559

Browse files
committed
getting_started.py now demonstrates how to use both the @with_argparser and @with_annotated decorators
1 parent 580233c commit c646559

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

examples/getting_started.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ def get_rprompt(self) -> AnyFormattedText:
164164
@cmd2.with_annotated
165165
def do_intro(
166166
self,
167-
interactive: Annotated[
167+
interactive: Annotated[ # Full annotation for an optional argument with default value and help text
168168
bool, Option(help_text="If True, prints a simulated interactive setup message after the intro banner")
169169
] = False,
170-
repeat: Annotated[int, Option(help_text="Number of times to repeat the intro banner")] = 1,
170+
repeat: int = 1, # Simple annotation for an optional argument with default value but no help text
171171
) -> None:
172172
"""Display the intro banner.
173173

0 commit comments

Comments
 (0)