Make server executable directly #1

Closed
VenomousSteam81 wants to merge 1 commit from VenomousSteam81/python-talk:master into master
Showing only changes of commit 7bfe8dda2b - Show all commits

View file

@ -1,4 +1,5 @@
#! /usr/bin/python3 #!/usr/bin/python3
import os, sys, asyncio, re, signal import os, sys, asyncio, re, signal
from platform import uname from platform import uname
from traceback import format_exc from traceback import format_exc
@ -50,9 +51,8 @@ try:
log("Explicitly erasing cached messages") log("Explicitly erasing cached messages")
G.msgs = [] G.msgs = []
elif arg in ["-?", "-h", "--help"]: elif arg in ["-?", "-h", "--help"]:
filename = filename if filename.startswith("./") else "python3 "+filename
print( print(
f"""{filename} <args> f"""python3 {filename} <args>
All arguments are optional! All arguments are optional!
All areguments are *expected* to only be specified once, if it appears mutliple times, the last one takes priority. All areguments are *expected* to only be specified once, if it appears mutliple times, the last one takes priority.
The exception to the above rule is `--link`, since you could want to link to multiple other servers. The exception to the above rule is `--link`, since you could want to link to multiple other servers.
@ -67,9 +67,9 @@ Accepted arguments:
--cwlgd - Crashes the server when outbound links go down --cwlgd - Crashes the server when outbound links go down
Examples: Examples:
{filename} --hostname=Fun-chat --link=chat.example.com:65048 --port=92628 python3 {filename} --hostname=Fun-chat --link=chat.example.com:65048 --port=92628
{filename} --no-logs --no-cache python3 {filename} --no-logs --no-cache
{filename} --address=127.0.0.1 -l -p=7288""" python3 {filename} --address=127.0.0.1 -l -p=7288"""
) )
exit(0) exit(0)
elif arg in ["-l", "--no-logs"]: elif arg in ["-l", "--no-logs"]: