Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Commit 0eaa710

Browse files
committed
fix: Use common pointer for common flags for dhcpdctl
1 parent 4e51a3f commit 0eaa710

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

cmd/dhcpdctl/cmd/apply.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,8 @@ var applyCmd = &cobra.Command{
6363

6464
func init() {
6565
var (
66-
serverHostPortFlag string
67-
configFileFlag string
68-
deviceFlag string
69-
subnetsFlag string
66+
deviceFlag string
67+
subnetsFlag string
7068
)
7169

7270
applyCmd.PersistentFlags().StringVarP(&serverHostPortFlag, serverHostPortKey, "s", constants.DHCPDDHostPortDefault, constants.HostPortDocs)

cmd/dhcpdctl/cmd/constants.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ const (
88
deviceKey = keyPrefix + "device"
99
subnetsKey = keyPrefix + "subnets"
1010
)
11+
12+
var (
13+
serverHostPortFlag string
14+
configFileFlag string
15+
)

cmd/dhcpdctl/cmd/delete.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ var deleteCmd = &cobra.Command{
6060
}
6161

6262
func init() {
63-
var (
64-
serverHostPortFlag string
65-
)
66-
6763
deleteCmd.PersistentFlags().StringVarP(&serverHostPortFlag, serverHostPortKey, "s", constants.DHCPDDHostPortDefault, constants.HostPortDocs)
6864

6965
if err := viper.BindPFlags(deleteCmd.PersistentFlags()); err != nil {

cmd/dhcpdctl/cmd/get.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ var getCmd = &cobra.Command{
7171
}
7272

7373
func init() {
74-
var (
75-
serverHostPortFlag string
76-
)
77-
7874
getCmd.PersistentFlags().StringVarP(&serverHostPortFlag, serverHostPortKey, "s", constants.DHCPDDHostPortDefault, constants.HostPortDocs)
7975

8076
if err := viper.BindPFlags(getCmd.PersistentFlags()); err != nil {

0 commit comments

Comments
 (0)