diff options
-rw-r--r-- | cmd2/cmd2.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index fc172708..ced8f62a 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -3168,8 +3168,10 @@ class Cmd(cmd.Cmd): history_action_group.add_argument('-c', '--clear', action='store_true', help='clear all history') history_format_group = history_parser.add_argument_group(title='formatting') - history_format_group.add_argument('-s', '--script', action='store_true', help='output commands in script format, i.e. without command numbers') - history_format_group.add_argument('-x', '--expanded', action='store_true', help='output expanded commands instead of entered command') + history_script_help = 'output commands in script format, i.e. without command numbers' + history_format_group.add_argument('-s', '--script', action='store_true', help=history_script_help) + history_expand_help = 'output expanded commands instead of entered command' + history_format_group.add_argument('-x', '--expanded', action='store_true', help=history_expand_help) history_format_group.add_argument('-v', '--verbose', action='store_true', help='display history and include expanded commands if they' ' differ from the typed command') @@ -3187,16 +3189,16 @@ class Cmd(cmd.Cmd): # -v must be used alone with no other options if args.verbose: - if args.clear or args.edit or args.output_file or args.run or args.transcript or args.expanded or args.script: + if args.clear or args.edit or args.output_file or args.run or args.transcript or args.expanded or args.script: self.poutput("-v can not be used with any other options") self.poutput(self.history_parser.format_usage()) return # -s and -x can only be used if none of these options are present: [-c -r -e -o -t] if (args.script or args.expanded) and (args.clear or args.edit or args.output_file or args.run or args.transcript): - self.poutput("-s and -x can not be used with -c, -r, -e, -o, or -t") - self.poutput(self.history_parser.format_usage()) - return + self.poutput("-s and -x can not be used with -c, -r, -e, -o, or -t") + self.poutput(self.history_parser.format_usage()) + return if args.clear: # Clear command and readline history |