111111 require('/path/to/src/docopt.php');
112112
113113 // short form, simple API
114- $args = Docopt::docopt ($doc);
114+ $args = Docopt::handle ($doc);
115115
116116 // long form, simple API (equivalent to short)
117117 $params = array(
120120 'version'=>null,
121121 'optionsFirst'=>false,
122122 );
123- $args = Docopt::docopt ($doc, $params);
123+ $args = Docopt::handle ($doc, $params);
124124
125125 // long form, full API
126126 $handler = new \Docopt\Handler(array(
@@ -264,6 +264,7 @@ Each pattern can consist of the following elements:
264264- **<arguments> **, **ARGUMENTS **. Arguments are specified as either
265265 upper-case words, e.g. ``my_program.php CONTENT-PATH `` or words
266266 surrounded by angular brackets: ``my_program.php <content-path> ``.
267+
267268- **--options **. Options are words started with dash (``- ``), e.g.
268269 ``--output ``, ``-o ``. You can "stack" several of one-letter
269270 options, e.g. ``-oiv `` which will be the same as ``-o -i -v ``. The
@@ -272,6 +273,7 @@ Each pattern can consist of the following elements:
272273 descriptions if you want your option to have an argument, a default
273274 value, or specify synonymous short/long versions of option (see next
274275 section on option descriptions).
276+
275277- **commands ** are words that do *not * follow the described above
276278 conventions of ``--options `` or ``<arguments> `` or ``ARGUMENTS ``,
277279 plus two special commands: dash "``- ``" and double dash "``-- ``"
@@ -281,22 +283,26 @@ Use the following constructs to specify patterns:
281283
282284- **[ ] ** (brackets) **optional ** elements. e.g.: ``my_program.php
283285 [-hvqo FILE] ``
286+
284287- **( ) ** (parens) **required ** elements. All elements that are *not *
285288 put in **[ ] ** are also required, e.g.: ``my_program.php
286289 --path=<path> <file>... `` is the same as ``my_program.php
287290 (--path=<path> <file>...) ``. (Note, "required options" might be not
288291 a good idea for your users).
292+
289293- **| ** (pipe) **mutually exclusive ** elements. Group them using **(
290294 ) ** if one of the mutually exclusive elements is required:
291295 ``my_program.php (--clockwise | --counter-clockwise) TIME ``. Group
292296 them using **[ ] ** if none of the mutually-exclusive elements are
293297 required: ``my_program.php [--left | --right] ``.
298+
294299- **... ** (ellipsis) **one or more ** elements. To specify that
295300 arbitrary number of repeating elements could be accepted, use
296301 ellipsis (``... ``), e.g. ``my_program.php FILE ... `` means one or
297302 more ``FILE ``-s are accepted. If you want to accept zero or more
298303 elements, use brackets, e.g.: ``my_program.php [FILE ...] ``. Ellipsis
299304 works as a unary operator on the expression to the left.
305+
300306- **[options] ** (case sensitive) shortcut for any options. You can
301307 use it if you want to specify that the usage pattern could be
302308 provided with any options defined below in the option-descriptions
0 commit comments