

def docpie(doc, argv=None, help=True, version=None, stdopt=True, attachopt=True, attachvalue=True, auto2dashes=True, name=None, case_sensitive=False, optionsfirst=False, appearedonly=False, namedoptions=False, extra=None):
    '\n    Parse `argv` based on command-line interface described in `doc`.\n\n    `docpie` creates your command-line interface based on its\n    description that you pass as `doc`. Such description can contain\n    --options, <positional-argument>, commands, which could be\n    [optional], (required), (mutually | exclusive) or repeated...\n    Parameters\n    ----------\n    doc : str\n        Description of your command-line interface.\n    argv : list of str, optional\n        Argument vector to be parsed. sys.argv is used if not\n        provided.\n    help : bool (default: True)\n        Set to False to disable automatic help on -h or --help\n        options.\n    version : any object but None\n        If passed, the object will be printed if --version is in\n        `argv`.\n    stdopt : bool (default: True)\n        When it\'s True, long flag should only starts with --\n    attachopt: bool (default: True)\n        write/pass several short flag into one, e.g. -abc can mean -a -b -c.\n        This only works when stdopt=True\n    attachvalue: bool (default: True)\n        allow you to write short flag and its value together,\n        e.g. -abc can mean -a bc\n    auto2dashes: bool (default: True)\n        automaticly handle -- (which means "end of command line flag")\n    name: str (default: None)\n        the "name" of your program. In each of your "usage" the "name" will be\n        ignored. By default docpie will ignore the first element of your\n        "usage".\n    case_sensitive: bool (default: False)\n        specifies if it need case sensitive when matching\n        "Usage:" and "Options:"\n    optionsfirst: bool (default: False)\n        everything after first positional argument will be interpreted as\n        positional argument\n    appearedonly: bool (default: False)\n        when set True, the options that never appear in argv will not\n        be put in result. Note this only affect options\n    extra: dict\n        customize pre-handled options. See\n        http://docpie.comes.today/document/advanced-apis/\n        for more infomation.\n    Returns\n    -------\n    args : dict\n        A dictionary, where keys are names of command-line elements\n        such as e.g. "--verbose" and "<path>", and values are the\n        parsed values of those elements.\n    Example\n    -------\n    >>> from docpie import docpie\n    >>> doc = \'\'\'\n    ... Usage:\n    ...     my_program tcp <host> <port> [--timeout=<seconds>]\n    ...     my_program serial <port> [--baud=<n>] [--timeout=<seconds>]\n    ...     my_program (-h | --help | --version)\n    ...\n    ... Options:\n    ...     -h, --help  Show this screen and exit.\n    ...     --baud=<n>  Baudrate [default: 9600]\n    ... \'\'\'\n    >>> argv = [\'my_program\', \'tcp\', \'127.0.0.1\', \'80\', \'--timeout\', \'30\']\n    >>> docpie(doc, argv)\n    {\n     \'--\': False,\n     \'-h\': False,\n     \'--baud\': \'9600\',\n     \'--help\': False,\n     \'--timeout\': \'30\',\n     \'--version\': False,\n     \'<host>\': \'127.0.0.1\',\n     \'<port>\': \'80\',\n     \'serial\': False,\n     \'tcp\': True}\n    See also\n    --------\n    * Full documentation is available in README.md as well as online\n      at http://docpie.comes.today/document/quick-start/\n    '
    if case_sensitive:
        warnings.warn('`case_sensitive` is deprecated, `docpie` is always case insensitive')
    kwargs = locals()
    argv = kwargs.pop('argv')
    pie = Docpie(**kwargs)
    pie.docpie(argv)
    return pie

dataset/ETHPy150Open TylerTemp/docpie/docpie/__init__.py docpie/original