def _create_command_line_parser():
"""Returns an argparse.ArgumentParser to parse command line arguments."""
parser = argparse.ArgumentParser(
usage='usage: %(prog)s [execution options] <script> [script_args]',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument(
'script',
help='the path to the PHP script that should be executed')
parser.add_argument(
'script_args',
help='the command arguments that will be passed to the script',
nargs=argparse.REMAINDER)
execution_group = parser.add_argument_group('Execution Options')
php_cli_path = _get_default_php_cli_path()
execution_group.add_argument('--php_executable_path', metavar='PATH',
type=_parse_path,
default=php_cli_path,
required=php_cli_path is None,
help='path to the PHP executable')
return parser
评论列表
文章目录