Skip to content

Commit 1050d99

Browse files
Update modular_commands.rst (#1199)
* Update modular_commands.rst The args given in the example are integers. Direct concatenation to string raises errors * Changed to f-string as per review comment Co-authored-by: Todd Leonhardt <todd.leonhardt@gmail.com>
1 parent 716ab8a commit 1050d99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/features/modular_commands.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ CommandSets and pass in the constructor to Cmd2.
100100
self._arg2 = arg2
101101
102102
def do_show_arg1(self, _: cmd2.Statement):
103-
self._cmd.poutput('Arg1: ' + self._arg1)
103+
self._cmd.poutput(f'Arg1: {self._arg1}')
104104
105105
def do_show_arg2(self, _: cmd2.Statement):
106-
self._cmd.poutput('Arg2: ' + self._arg2)
106+
self._cmd.poutput(f'Arg2: {self._arg2}')
107107
108108
class ExampleApp(cmd2.Cmd):
109109
"""

0 commit comments

Comments
 (0)