def _cli_parse(args): # pragma: no coverage
from argparse import ArgumentParser
parser = ArgumentParser(usage="usage: %sprog [options] package.module:app")
opt = parser.add_argument
opt('app', help='WSGI app entry point.')
opt("--version", action="store_true", help="show version number.")
opt("-b", "--bind", metavar="ADDRESS", help="bind socket to ADDRESS.")
opt("-s", "--server", default='wsgiref', help="use SERVER as backend.")
opt("-p", "--plugin", action="append", help="install additional plugin/s.")
opt("-c", "--conf", action="append", metavar="FILE",
help="load config values from FILE.")
opt("-C", "--param", action="append", metavar="NAME=VALUE",
help="override config values.")
opt("--debug", action="store_true", help="start server in debug mode.")
opt("--reload", action="store_true", help="auto-reload on file changes.")
cli_args = parser.parse_args(args)
return cli_args, parser
评论列表
文章目录