Skip to content

Commit fff7155

Browse files
committed
Merge pull request #10 from FedericoCeratto/patch-1
Add multiple values example
2 parents 8832cb1 + efaa986 commit fff7155

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ if args["move"]:
3636
ships[$args["<name>"]].move(
3737
parseFloat($args["<x>"]), parseFloat($args["<y>"]),
3838
speed = parseFloat($args["--speed"]))
39+
40+
if args["new"]:
41+
for name in @(args["<name>"]):
42+
echo "Creating ship $#" % name
3943
```
4044

4145
The option parser is generated based on the docstring above that is passed to `docopt` function. `docopt` parses the usage pattern (`"Usage: ..."`) and option descriptions (lines starting with dash "`-`") and ensures that the program invocation matches the usage pattern; it parses options, arguments and commands based on that. The basic idea is that *a good help message has all necessary information in it to make a parser*.

0 commit comments

Comments
 (0)