diff --git a/README.md b/README.md index 63911fb..ebe5f3f 100644 --- a/README.md +++ b/README.md @@ -131,10 +131,14 @@ app.Flags = []cli.Flag { cli.StringFlag{"lang", "english", "language for the greeting"}, } app.Action = func(c *cli.Context) { + name := "someone" + if len(c.Args()) > 0 { + name = c.Args()[0] + } if c.String("lang") == "spanish" { - println("Hola", c.Args()[0]) + println("Hola", name) } else { - println("Hello", c.Args()[0]) + println("Hello", name) } } ...