Skip to content

Commit

Permalink
#15 add --version to command line
Browse files Browse the repository at this point in the history
  • Loading branch information
kwabenantim committed Mar 24, 2024
1 parent 04c67c3 commit c782159
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cppwg/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import argparse
import logging

from cppwg import CppWrapperGenerator
from cppwg import CppWrapperGenerator, __version__


def parse_args() -> argparse.Namespace:
Expand Down Expand Up @@ -67,6 +67,14 @@ def parse_args() -> argparse.Namespace:
help="Disable info messages.",
)

parser.add_argument(
"-v",
"--version",
action="version",
version=__version__,
help="Print cppwg version.",
)

args = parser.parse_args()

return args
Expand All @@ -81,7 +89,6 @@ def generate(args: argparse.Namespace) -> None:
args : argparse.Namespace
The parsed command line arguments.
"""

castxml_cflags = None
if args.std:
castxml_cflags = f"-std={args.std}"
Expand Down

0 comments on commit c782159

Please sign in to comment.