跳转到主要内容

Parguments:Python的一个简单的命令行参数解析器

项目描述

Python的一个简单的命令行参数解析器。

用于创建命令行脚本。

示例

"""
catsup v1.0

Usage:
    catsup init [<path>]
    catsup build
    catsup deploy
    catsup -h | --help
    catsup --version

Options:
    -h --help             Show this screen and exit.
    -s --settings=<file>  path to config file. [default: config.json]
"""
from parguments import Parguments

parguments = Parguments(__doc__, version='1.0')

@parguments.command
def init(path):
  """
  Usage:
    catsup init [<path>]

  Options:
    -h --help             Show this screen and exit.
    -s --settings=<file>  path to setting file. [default: config.json]
  """
  pass

@parguments.command
def build(settings):
  """
  Usage:
    catsup build [-s <file>|--settings=<file>]

  Options:
    -h --help             Show this screen and exit.
    -s --settings=<file>  path to setting file. [default: config.json]
  """
  pass

@parguments.command
def deploy(settings):
  """
  Usage:
    catsup deploy [-s <file>|--settings=<file>]

  Options:
    -h --help             Show this screen and exit.
    -s --settings=<file>  path to setting file. [default: config.json]
  """
  pass

if __name__ == '__main__':
  parguments.run()

文档在http://parguments.rtfd.org/

项目详情


下载文件

下载适合您平台文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

parguments-0.3.2.tar.gz (5.0 kB 查看哈希值)

上传时间:

构建分布

parguments-0.3.2-py2.7.egg (9.0 kB 查看哈希值)

上传时间:

由以下提供支持