Skip to content

Commit baef7f0

Browse files
committed
Add --version flag to display mxmake version
Adds -v/--version command line option that prints the current mxmake version using the auto-generated version from hatch-vcs.
1 parent 957314d commit baef7f0

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
- Enhancement: Use tables in the generated sphinx code for topic/domains.
66
[jensens, 02-11-2025]
77

8+
- Feature: Add `--version` (`-v`) command line flag to display mxmake version.
9+
[jensens, 02-11-2025]
10+
811
## 2.0.0 (2025-10-24)
912

1013
- **Breaking**: Drop Python 3.9 support. Minimum Python version is now 3.10.

src/mxmake/main.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from ._version import __version__
12
from .helpgen import print_help
23
from .parser import MakefileParser
34
from .templates import ci_template
@@ -27,6 +28,12 @@
2728

2829

2930
parser = argparse.ArgumentParser()
31+
parser.add_argument(
32+
"-v",
33+
"--version",
34+
action="version",
35+
version=f"%(prog)s {__version__}",
36+
)
3037
command_parsers = parser.add_subparsers(dest="command", required=True)
3138

3239

0 commit comments

Comments
 (0)