-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redo disasembler options handling --
* --show-bytes and --asm options removed. Use --asm-format -F instead. * asm_fmt is now a string choice. * Don't show integer arg value when there is something more useful to show. Note that -F=bytes will show this separately
- Loading branch information
rocky
committed
Jun 21, 2020
1 parent
6063906
commit e6e146f
Showing
7 changed files
with
65 additions
and
421 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Mode: -*- python -*- | ||
# Copyright (c) 2015-2019 by Rocky Bernstein <[email protected]> | ||
# Copyright (c) 2015-2020 by Rocky Bernstein <[email protected]> | ||
# | ||
# Note: we can't start with #! because setup.py bdist_wheel will look for that | ||
# and change that into something that's not portable. Thank you, Python! | ||
|
@@ -21,23 +21,14 @@ | |
|
||
@click.command() | ||
@click.option( | ||
"--asm/--noasm", | ||
default=False, | ||
help="Produce output suitable for the xasm assembler", | ||
) | ||
@click.option( | ||
"--show-bytes/--noshow-bytes", | ||
default=False, | ||
help="include bytecode bytes in output", | ||
"--format", | ||
"-F", | ||
type=click.Choice(["xasm", "bytes", "std", "extended", "header"], | ||
case_sensitive=False), | ||
) | ||
@click.version_option(version=VERSION) | ||
@click.option( | ||
"--header/--no-header", | ||
default=False, | ||
help="Show only the module header information", | ||
) | ||
@click.argument("files", nargs=-1, type=click.Path(readable=True), required=True) | ||
def main(asm, show_bytes, header, files): | ||
def main(format, files): | ||
"""Disassembles a Python bytecode file. | ||
We handle bytecode for virtually every release of Python and some releases of PyPy. | ||
|
@@ -72,7 +63,7 @@ def main(asm, show_bytes, header, files): | |
) | ||
continue | ||
|
||
disassemble_file(path, sys.stdout, asm, header, show_bytes) | ||
disassemble_file(path, sys.stdout, format) | ||
return | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.