Skip to content

Commit

Permalink
Fix Command snippet in README (#46)
Browse files Browse the repository at this point in the history
Calls for opts and args did not match the actual signature.
  • Loading branch information
ggiamarchi authored and jawher committed Apr 30, 2017
1 parent d3ffbc2 commit 8327d12
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ In this function, you can add options and arguments by calling the same methods
You would also assign a function to the Action field of the Cmd struct for it to be executed when the command is invoked.
```go
docker.Command("run", "Run a command in a new container", func(cmd *cli.Cmd) {
detached := cmd.BoolOpt("d detach", false, "Detached mode: run the container in the background and print the new container ID", nil)
memory := cmd.StringOpt("m memory", "", "Memory limit (format: <number><optional unit>, where unit = b, k, m or g)", nil)
detached := cmd.BoolOpt("d detach", false, "Detached mode: run the container in the background and print the new container ID")
memory := cmd.StringOpt("m memory", "", "Memory limit (format: <number><optional unit>, where unit = b, k, m or g)")

image := cmd.StringArg("IMAGE", "", "", nil)
image := cmd.StringArg("IMAGE", "", "")

cmd.Action = func() {
if *detached {
Expand Down

0 comments on commit 8327d12

Please sign in to comment.