-
Notifications
You must be signed in to change notification settings - Fork 202
/
__main__.py
36 lines (31 loc) · 855 Bytes
/
__main__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import argparse
import sys
import sysconfig # type: ignore
from . import __version__, include_dir, cmake_dir
def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument(
"--version",
action="version",
version=__version__,
help="Print the version number.",
)
parser.add_argument(
"--include_dir",
action="store_true",
help="Print the path to the nanobind C++ header directory."
)
parser.add_argument(
"--cmake_dir",
action="store_true",
help="Print the path to the nanobind CMake module directory."
)
args = parser.parse_args()
if not sys.argv[1:]:
parser.print_help()
if args.include_dir:
print(include_dir())
if args.cmake_dir:
print(cmake_dir())
if __name__ == "__main__":
main()