mirror of
https://github.com/yudai/gotty.git
synced 2025-09-22 05:50:48 +02:00
Random URL generation(Close #17)
This commit is contained in:
parent
2aaa155a3e
commit
b15227c696
2 changed files with 35 additions and 11 deletions
7
main.go
7
main.go
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue