Skip to content

Commit df9e5c1

Browse files
committed
Small asmft error message tweak
1 parent 24a58b8 commit df9e5c1

1 file changed

Lines changed: 18 additions & 19 deletions

File tree

trepan/processor/command/set_subcmd/asmfmt.py

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright (C) 2020 Rocky Bernstein
2+
# Copyright (C) 2020, 2021 Rocky Bernstein
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by
@@ -20,31 +20,32 @@
2020

2121
choices = ["classic", "extended", "extended-bytes", "bytes"]
2222

23+
2324
class SetAsmFmt(DebuggerSubcommand):
2425
"""**set asmfmt** {**classic** | **extended** | **bytes** | **extended-bytes**}
2526
26-
The style of format to use in disassembly:
27+
The style of format to use in disassembly:
2728
28-
classic: fields: line, marker offset, opcode operand
29-
extended: above, but we try harder to get operand information from previous instructions
30-
bytes: like classic but we show the instruction bytes after the offset
31-
extended-bytes: bytes + extended
29+
classic: fields: line, marker offset, opcode operand
30+
extended: above, but we try harder to get operand information from previous instructions
31+
bytes: like classic but we show the instruction bytes after the offset
32+
extended-bytes: bytes + extended
3233
3334
34-
Examples:
35-
--------
35+
Examples:
36+
--------
3637
37-
set asmfmt extended # this is the default
38-
set asmfmt classic # no highlight
38+
set asmfmt extended # this is the default
39+
set asmfmt classic # no highlight
3940
40-
See also:
41-
---------
42-
`show asmfmt`"""
41+
See also:
42+
---------
43+
`show asmfmt`"""
4344

4445
in_list = True
4546
max_args = 1
46-
min_args = 0
4747
min_abbrev = len("asmf")
48+
min_args = 0
4849
short_help = "Set disassembly style"
4950

5051
def complete(self, prefix):
@@ -56,10 +57,7 @@ def get_format_type(self, arg):
5657
if arg in choices:
5758
return arg
5859
else:
59-
self.errmsg(
60-
'Expecting %s"; got %s'
61-
% (", ".join(choices), arg)
62-
)
60+
self.errmsg("Expecting one of: %s; got: %s." % (", ".join(choices), arg))
6361
return None
6462
pass
6563

@@ -79,7 +77,8 @@ def run(self, args):
7977
pass
8078

8179

82-
if __name__ == '__main__':
80+
if __name__ == "__main__":
8381
from trepan.processor.command.set_subcmd.__demo_helper__ import demo_run
82+
8483
demo_run(SetAsmFmt, ["classic"])
8584
pass

0 commit comments

Comments
 (0)