expandOptionsShortcut

private fnvoid expandOptionsShortcut(Pattern pattern, const Option[] options)
  • Overload of docopt that accepts a compile-time parsed descriptor. *
  • This avoids reparsing the documentation at runtime when a string literal
  • was available at compile time. Semantics are equivalent to the string
  • overload. Expand every [options] shortcut in pattern with the options declared in the document that do not already appear literally in the pattern.

Shared by both docopt overloads so the expansion cannot drift.

Parameters

patternRoot usage pattern (mutated in place).
optionsOptions declared by the document (pre-argv list).