Skip to content

Commit 740bf75

Browse files
committed
Fix flake errors
1 parent b7fc503 commit 740bf75

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

cmd2/cmd2.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3168,8 +3168,10 @@ def load_ipy(app):
31683168
history_action_group.add_argument('-c', '--clear', action='store_true', help='clear all history')
31693169

31703170
history_format_group = history_parser.add_argument_group(title='formatting')
3171-
history_format_group.add_argument('-s', '--script', action='store_true', help='output commands in script format, i.e. without command numbers')
3172-
history_format_group.add_argument('-x', '--expanded', action='store_true', help='output expanded commands instead of entered command')
3171+
history_script_help = 'output commands in script format, i.e. without command numbers'
3172+
history_format_group.add_argument('-s', '--script', action='store_true', help=history_script_help)
3173+
history_expand_help = 'output expanded commands instead of entered command'
3174+
history_format_group.add_argument('-x', '--expanded', action='store_true', help=history_expand_help)
31733175
history_format_group.add_argument('-v', '--verbose', action='store_true',
31743176
help='display history and include expanded commands if they'
31753177
' differ from the typed command')
@@ -3187,16 +3189,16 @@ def do_history(self, args: argparse.Namespace) -> None:
31873189

31883190
# -v must be used alone with no other options
31893191
if args.verbose:
3190-
if args.clear or args.edit or args.output_file or args.run or args.transcript or args.expanded or args.script:
3192+
if args.clear or args.edit or args.output_file or args.run or args.transcript or args.expanded or args.script:
31913193
self.poutput("-v can not be used with any other options")
31923194
self.poutput(self.history_parser.format_usage())
31933195
return
31943196

31953197
# -s and -x can only be used if none of these options are present: [-c -r -e -o -t]
31963198
if (args.script or args.expanded) and (args.clear or args.edit or args.output_file or args.run or args.transcript):
3197-
self.poutput("-s and -x can not be used with -c, -r, -e, -o, or -t")
3198-
self.poutput(self.history_parser.format_usage())
3199-
return
3199+
self.poutput("-s and -x can not be used with -c, -r, -e, -o, or -t")
3200+
self.poutput(self.history_parser.format_usage())
3201+
return
32003202

32013203
if args.clear:
32023204
# Clear command and readline history

0 commit comments

Comments
 (0)