Better formatting in evennia launcher help
This commit is contained in:
parent
815ef198f5
commit
55d21500de
1 changed files with 20 additions and 8 deletions
|
|
@ -449,6 +449,19 @@ SERVER_INFO = \
|
||||||
{errors}"""
|
{errors}"""
|
||||||
|
|
||||||
|
|
||||||
|
ARG_OPTIONS = \
|
||||||
|
"""Actions on installed server. One of:
|
||||||
|
start - launch server+portal if not running
|
||||||
|
stop - shutdown server+portal
|
||||||
|
reload - restart server (code refresh)
|
||||||
|
reset - mimic server shutdown but with auto-restart
|
||||||
|
sstart - start only server (requires portal)
|
||||||
|
status - server and portal run state
|
||||||
|
info - get server and portal port info
|
||||||
|
menu - show a menu of options
|
||||||
|
Unregognized input is passed on to Django."""
|
||||||
|
|
||||||
|
|
||||||
# Info formatting
|
# Info formatting
|
||||||
|
|
||||||
def print_info(portal_info_dict, server_info_dict):
|
def print_info(portal_info_dict, server_info_dict):
|
||||||
|
|
@ -1554,7 +1567,7 @@ def main():
|
||||||
|
|
||||||
# set up argument parser
|
# set up argument parser
|
||||||
|
|
||||||
parser = ArgumentParser(description=CMDLINE_HELP)
|
parser = ArgumentParser(description=CMDLINE_HELP, formatter_class=argparse.RawTextHelpFormatter)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--gamedir', nargs=1, action='store', dest='altgamedir',
|
'--gamedir', nargs=1, action='store', dest='altgamedir',
|
||||||
metavar="<path>",
|
metavar="<path>",
|
||||||
|
|
@ -1564,17 +1577,17 @@ def main():
|
||||||
help="Creates a new gamedir 'name' at current location.")
|
help="Creates a new gamedir 'name' at current location.")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--list', nargs='+', action='store', dest='listsetting', metavar="all|<key>",
|
'--list', nargs='+', action='store', dest='listsetting', metavar="all|<key>",
|
||||||
help=("List values for one or more server settings. Use 'all' to list all "
|
help=("List values for one or more server settings. Use 'all' to \n list all "
|
||||||
"available keys."))
|
"available keys."))
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--settings', nargs=1, action='store', dest='altsettings',
|
'--settings', nargs=1, action='store', dest='altsettings',
|
||||||
default=None, metavar="<path>",
|
default=None, metavar="<path>",
|
||||||
help=("Start evennia with alternative settings file from "
|
help=("Start evennia with alternative settings file from\n"
|
||||||
" gamedir/server/conf/. (default is settings.py)"))
|
" gamedir/server/conf/. (default is settings.py)"))
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--initsettings', action='store_true', dest="initsettings",
|
'--initsettings', action='store_true', dest="initsettings",
|
||||||
default=False,
|
default=False,
|
||||||
help="Create a new, empty settings file as gamedir/server/conf/settings.py.")
|
help="Create a new, empty settings file as\n gamedir/server/conf/settings.py.")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--profiler', action='store_true', dest='profiler', default=False,
|
'--profiler', action='store_true', dest='profiler', default=False,
|
||||||
help="Start given server component under the Python profiler.")
|
help="Start given server component under the Python profiler.")
|
||||||
|
|
@ -1589,10 +1602,9 @@ def main():
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"operation", nargs='?', default="noop",
|
"operation", nargs='?', default="noop",
|
||||||
help=("One of start, stop, reload, reset, sstart, info, status and menu. "
|
help=ARG_OPTIONS)
|
||||||
"Unregognized input is passed on to Django."))
|
|
||||||
parser.epilog = (
|
parser.epilog = (
|
||||||
"Common Django-admin commands are shell, dbshell, migrate and flush. "
|
"Common Django-admin commands are shell, dbshell, migrate and flush.\n"
|
||||||
"See the django documentation for more django-admin commands.")
|
"See the django documentation for more django-admin commands.")
|
||||||
|
|
||||||
args, unknown_args = parser.parse_known_args()
|
args, unknown_args = parser.parse_known_args()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue