Skip to content

Commit 4a9abae

Browse files
committed
Correct the value type of the --persistent-keepalive
Prefious: ``` --persistent-keepalive PersistentKeepalive WireGuard PersistentKeepalive for the SORACOM Arc server, which will override arc.json#persistentKeepalive value (default 60) ``` Corrected: ``` --persistent-keepalive int WireGuard "PersistentKeepalive" for the SORACOM Arc server, which will override arc.json#persistentKeepalive value (default 60) ``` This because of the `pflag` package trick; that package extracts the back-quoted word from the usage text and guess/use that word as the type of value. ref: spf13/pflag#200 This might come from the original golang's flag package: > can be changed by placing a back-quoted name in the flag's usage string; > the first such item in the message is taken to be a parameter name to > show in the message and the back quotes are stripped from the message > when displayed > https://pkg.go.dev/flag#PrintDefaults So this patch replaces the back-quotes with double-quotes to avoid the unexpected behavior. Signed-off-by: moznion <[email protected]>
1 parent b48b143 commit 4a9abae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/up.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func upCmd() *cobra.Command {
8080
}
8181

8282
cmd.Flags().IntVar(&mtu, "mtu", soratun.DefaultMTU, "MTU for the interface, which will override arc.json#mtu value")
83-
cmd.Flags().IntVar(&persistentKeepalive, "persistent-keepalive", soratun.DefaultPersistentKeepaliveInterval, "WireGuard `PersistentKeepalive` for the SORACOM Arc server, which will override arc.json#persistentKeepalive value")
83+
cmd.Flags().IntVar(&persistentKeepalive, "persistent-keepalive", soratun.DefaultPersistentKeepaliveInterval, "WireGuard \"PersistentKeepalive\" for the SORACOM Arc server, which will override arc.json#persistentKeepalive value")
8484
cmd.Flags().StringVar(&additionalAllowedIPs, "additional-allowed-ips", "", "Comma separated string of additional WireGuard allowed CIDRs, which will be added to arc.json#additionalAllowedIPs array")
8585
cmd.Flags().BoolVar(&readStdin, "read-stdin", false, "read configuration from stdin, ignoring --config setting")
8686

0 commit comments

Comments
 (0)