Random URL generation(Close #17)

This commit is contained in:
Shoji Ihara 2015-08-19 20:35:04 +09:00
parent 2aaa155a3e
commit b15227c696
2 changed files with 35 additions and 11 deletions

View file

@ -37,6 +37,11 @@ func main() {
Usage: "Credential for Basic Authentication (ex: user:pass)",
EnvVar: "GOTTY_CREDENTIAL",
},
cli.BoolFlag{
Name: "random-url, r",
Usage: "Add a random string to the URL",
EnvVar: "GOTTY_RANDOM_URL",
},
}
cmd.Action = func(c *cli.Context) {
if len(c.Args()) == 0 {
@ -44,7 +49,7 @@ func main() {
cli.ShowAppHelp(c)
os.Exit(1)
}
app := app.New(c.String("addr"), c.String("port"), c.Bool("permit-write"), c.String("credential"), c.Args())
app := app.New(c.String("addr"), c.String("port"), c.Bool("permit-write"), c.String("credential"), c.Bool("random-url"), c.Args())
err := app.Run()
if err != nil {
fmt.Println(err)