MCPcopy
hub / github.com/docopt/docopt / parse_defaults

Function parse_defaults

docopt.py:454–461  ·  view source on GitHub ↗
(doc)

Source from the content-addressed store, hash-verified

452
453
454def parse_defaults(doc):
455 # in python < 2.7 you can't pass flags=re.MULTILINE
456 split = re.split('\n *(<\S+?>|-\S+?)', doc)[1:]
457 split = [s1 + s2 for s1, s2 in zip(split[::2], split[1::2])]
458 options = [Option.parse(s) for s in split if s.startswith('-')]
459 #arguments = [Argument.parse(s) for s in split if s.startswith('<')]
460 #return options, arguments
461 return options
462
463
464def printable_usage(doc):

Callers 1

docoptFunction · 0.85

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…