__main__.py with argparse
This commit is contained in:
parent
446ab11a61
commit
b3fedb8214
39
sampy/__main__.py
Normal file
39
sampy/__main__.py
Normal file
|
@ -0,0 +1,39 @@
|
|||
import argparse
|
||||
import textwrap
|
||||
|
||||
|
||||
def main(args: argparse.Namespace) -> int:
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
class Formatter(
|
||||
argparse.ArgumentDefaultsHelpFormatter, argparse.RawTextHelpFormatter
|
||||
):
|
||||
pass
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
prog="sampy",
|
||||
description="A SAMP server made in python",
|
||||
epilog=textwrap.dedent(
|
||||
"""
|
||||
SAMP (or SA-MP) is a free multiplayer mod for the PC port of GTA: San Andreas.
|
||||
GTA: San Andreas was developed by Rockstar North and released in 2005.
|
||||
SA-MP is an unofficial multiplayer mod made by the `SA-MP.com` team released @[sa-mp.com](https://www.sa-mp.com/)
|
||||
"""
|
||||
),
|
||||
formatter_class=Formatter,
|
||||
)
|
||||
parser.add_argument("--host", type=str, default="0.0.0.0", help="Server host ip")
|
||||
parser.add_argument("-p", "--port", type=int, default=7777, help="Server port")
|
||||
parser.add_argument(
|
||||
"-v",
|
||||
"--version",
|
||||
type=str,
|
||||
default="latest",
|
||||
help="Game version",
|
||||
choices=["latest"],
|
||||
)
|
||||
args = parser.parse_args()
|
||||
raise SystemExit(main(args))
|
Loading…
Reference in New Issue
Block a user