11#!/usr/bin/env python3
2- """A simple example cmd2 application demonstrating the following:
2+ """A simple example cmd2 application demonstrating many common features.
3+
4+ Features demonstrated include all of the following:
35 1) Colorizing/stylizing output
46 2) Using multiline commands
57 3) Persistent history
2527
2628
2729class BasicApp (cmd2 .Cmd ):
30+ """Cmd2 application to demonstrate many common features."""
31+
2832 CUSTOM_CATEGORY = 'My Custom Commands'
2933
3034 def __init__ (self ) -> None :
35+ """Initialize the cmd2 application."""
3136 # Startup script that defines a couple aliases for running shell commands
3237 alias_script = pathlib .Path (__file__ ).absolute ().parent / '.cmd2rc'
3338
@@ -39,7 +44,7 @@ def __init__(self) -> None:
3944 multiline_commands = ['echo' ],
4045 persistent_history_file = 'cmd2_history.dat' ,
4146 shortcuts = shortcuts ,
42- startup_script = alias_script ,
47+ startup_script = str ( alias_script ) ,
4348 )
4449
4550 # Prints an intro banner once upon application startup
@@ -82,7 +87,7 @@ def do_intro(self, _: cmd2.Statement) -> None:
8287
8388 @cmd2 .with_category (CUSTOM_CATEGORY )
8489 def do_echo (self , arg : cmd2 .Statement ) -> None :
85- """Example of a multiline command."""
90+ """Multiline command."""
8691 self .poutput (
8792 stylize (
8893 arg ,
0 commit comments