commit
933a037bf0
@ -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)
|
||||
}
|
||||
}
|
||||
...
|
||||
|
Loading…
Reference in New Issue
Block a user