Support auto reconnection

A new option `--auto-reconnect` which takes seconds to reconnect is
added.
This commit is contained in:
Iwasaki Yudai 2015-08-24 07:14:24 +09:00
parent 4df9ac8059
commit acacba6f03
6 changed files with 97 additions and 55 deletions

View file

@ -55,6 +55,12 @@ func main() {
Usage: "Title format of browser window",
EnvVar: "GOTTY_TITLE_FORMAT",
},
cli.IntFlag{
Name: "auto-reconnect",
Value: -1,
Usage: "Seconds to automatically reconnect to the server when the connection is closed (default: disabled)",
EnvVar: "GOTTY_AUTO_RECONNECT",
},
}
cmd.Action = func(c *cli.Context) {
if len(c.Args()) == 0 {
@ -72,6 +78,7 @@ func main() {
c.Bool("random-url"),
c.String("profile-file"),
c.String("title-format"),
c.Int("auto-reconnect"),
c.Args(),
},
)