better explain nearpc behaviour (#2340)

This commit is contained in:
k4lizen 2024-08-07 10:44:01 +02:00 committed by GitHub
parent 42869c0be9
commit 88e1eb203e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -19,7 +19,7 @@ usage: nearpc [-h] [-e] [pc] [lines]
|Positional Argument|Help|
| :--- | :--- |
|`pc`|Address to disassemble near.|
|`pc`|Address to disassemble near. If this is the only argument and the value provided is small enough, it is interpreted as lines instead.|
|`lines`|Number of lines to show on either side of the address.|
## Optional Arguments

View File

@ -6,7 +6,13 @@ import pwndbg.gdblib.nearpc
from pwndbg.commands import CommandCategory
parser = argparse.ArgumentParser(description="Disassemble near a specified address.")
parser.add_argument("pc", type=int, nargs="?", default=None, help="Address to disassemble near.")
parser.add_argument(
"pc",
type=int,
nargs="?",
default=None,
help="Address to disassemble near. If this is the only argument and the value provided is small enough, it is interpreted as lines instead.",
)
parser.add_argument(
"lines",
type=int,