Skip to content

Commit 4ea05f2

Browse files
author
Thibault Gilles
committed
Allow to use the token and frequency flags in json mode
1 parent 2f5ca53 commit 4ea05f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ var frequency time.Duration
1515
var port int
1616

1717
func init() {
18-
RootCmd.Flags().StringVarP(&token, "token", "t", "", "Consul token used for registration")
18+
RootCmd.PersistentFlags().StringVarP(&token, "token", "t", "", "Consul token used for registration")
1919
RootCmd.Flags().StringVarP(&service, "service", "s", "", "Consul Service Name")
2020
RootCmd.Flags().IntVarP(&port, "port", "p", 0, "Service port")
21-
RootCmd.Flags().DurationVarP(&frequency, "frequency", "f", 30*time.Second, "Health Check Frequency (in seconds)")
21+
RootCmd.PersistentFlags().DurationVarP(&frequency, "frequency", "f", 30*time.Second, "Health Check Frequency (in seconds)")
2222
}
2323

2424
var RootCmd = &cobra.Command{

0 commit comments

Comments
 (0)