-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path__main__.py
More file actions
38 lines (31 loc) · 1.03 KB
/
__main__.py
File metadata and controls
38 lines (31 loc) · 1.03 KB
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
37
38
# This file is part of PROJECT.
#
# PROJECT is free software: you can redistribute it and/or
# modify it under the terms of the Apache 2.0 License as published by
# the Apache Software Foundation.
#
# PROJECT is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License
# for more details.
#
# You should have received a copy of the Apache 2.0 License
# along with PROJECT.
# If not, see <https://www.apache.org/licenses/LICENSE-2.0>.
from .module import square
from ._version import __version__
def main() -> int:
import argparse
parser = argparse.ArgumentParser(prog="Squarer of ints")
parser.add_argument("x", type=int)
parser.add_argument(
"--version",
action="version",
version=f"%(prog)s, version {__version__}",
)
args = parser.parse_args()
print(f"Square of {args.x} is {square(args.x)}")
return 0
if __name__ == "__main__":
import sys
sys.exit(main())