Account for executing directly in help message

This commit is contained in:
Firepup Sixfifty 2024-07-16 22:35:52 +00:00
parent 2b6d4c82e9
commit 581813734f
Signed by: Firepup650
SSH key fingerprint: SHA256:U0Zp8EhEe3CMqFSrC79CqatzaEiL4sjta80/RSX2XrY

View file

@ -50,8 +50,9 @@ 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"""python3 {filename} <args> f"""{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.
@ -66,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:
python3 {filename} --hostname=Fun-chat --link=chat.example.com:65048 --port=92628 {filename} --hostname=Fun-chat --link=chat.example.com:65048 --port=92628
python3 {filename} --no-logs --no-cache {filename} --no-logs --no-cache
python3 {filename} --address=127.0.0.1 -l -p=7288""" {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"]: