Skip to content

Commit

Permalink
Add a --version command line flag to show the version
Browse files Browse the repository at this point in the history
This will help users report the version of pystack when creating bug
reports more easily.

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
  • Loading branch information
pablogsal authored and godlygeek committed Aug 9, 2024
1 parent 5b7c726 commit ce72e69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions news/203.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a new ``--version`` command line flag to show the version of pystack
4 changes: 4 additions & 0 deletions src/pystack/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from typing import Optional
from typing import Set

from pystack import __version__
from pystack.errors import InvalidPythonProcess
from pystack.process import decompress_gzip
from pystack.process import is_elf
Expand Down Expand Up @@ -118,6 +119,9 @@ def generate_cli_parser() -> argparse.ArgumentParser:
parser.add_argument(
"-v", "--verbose", action="count", default=0, dest="global_verbose"
)
parser.add_argument(
"--version", action="version", version=__version__, help="Show version"
)
parser.add_argument(
"--no-color",
action="store_true",
Expand Down

0 comments on commit ce72e69

Please sign in to comment.