2,190
社区成员
发帖
与我相关
我的任务
分享
package main
import (
"github.com/codegangsta/cli"
//"fmt"
"os"
)
func main() {
app := cli.NewApp()
app.Name = "greet"
app.Usage = "fight the loneliness!"
app.Action = func(c *cli.Context) {
println("hello", c.Args()[0])
}
app.Run(os.Args)
}
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
package main
import (
"fmt"
"os"
"strings"
)
func main() {
who:="World!"
if len(os.Args)>1 {
who =strings.Join(os.Args[1:]," ")
}
fmt.Println("Hello",who)
}