MCPcopy
hub / github.com/docopt/docopt / printable_usage

Function printable_usage

docopt.py:464–471  ·  view source on GitHub ↗
(doc)

Source from the content-addressed store, hash-verified

462
463
464def printable_usage(doc):
465 # in python < 2.7 you can't pass flags=re.IGNORECASE
466 usage_split = re.split(r'([Uu][Ss][Aa][Gg][Ee]:)', doc)
467 if len(usage_split) < 3:
468 raise DocoptLanguageError('"usage:" (case-insensitive) not found.')
469 if len(usage_split) > 3:
470 raise DocoptLanguageError('More than one "usage:" (case-insensitive).')
471 return re.split(r'\n\s*\n', ''.join(usage_split[1:]))[0].strip()
472
473
474def formal_usage(printable_usage):

Callers 2

docoptFunction · 0.85

Calls 1

DocoptLanguageErrorClass · 0.85

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…