cli: rename -reconnect-delay to -reconnect-delay-secs

All time arguments now use -secs suffix with integer seconds for
consistency (-reconnect-delay-secs, -keepalive-timeout-secs).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Git Sagar 2026-07-11 11:56:37 -03:00
parent 20f41353e7
commit 4c2b4dcec1
3 changed files with 6 additions and 5 deletions

View file

@ -31,7 +31,7 @@ func main() {
macAddr := flag.String("mac", "", "TAP interface MAC address (e.g. 5E:3B:6F:63:A8:3E)")
insecure := flag.Bool("insecure", false, "Skip TLS certificate verification")
noDHCP := flag.Bool("no-dhcp", false, "Disable built-in DHCP client")
reconnectDelay := flag.Duration("reconnect-delay", 5*time.Second, "Delay between reconnection attempts")
reconnectDelay := flag.Int("reconnect-delay-secs", 5, "Delay between reconnection attempts in seconds")
acceptDefaultGW := flag.Bool("accept-default-gateway", false, "Install DHCP-provided gateway as default route")
acceptStaticRoutes := flag.Bool("accept-static-routes", false, "Install DHCP classless static routes (option 121/249)")
acceptDNS := flag.Bool("accept-dns", false, "Set /etc/resolv.conf from DHCP-provided DNS servers")
@ -106,13 +106,14 @@ func main() {
return
}
log.Printf("session ended: %v", err)
log.Printf("reconnecting in %v...", *reconnectDelay)
delay := time.Duration(*reconnectDelay) * time.Second
log.Printf("reconnecting in %v...", delay)
select {
case <-sig:
log.Println("shutting down")
return
case <-time.After(*reconnectDelay):
case <-time.After(delay):
}
}
}