Skip to content

Commit 2ec29aa

Browse files
committed
fix flag names
1 parent d8015a3 commit 2ec29aa

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

internal/cmd/beta/network/create/create.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ const (
3232
ipv6PrefixFlag = "ipv6-prefix"
3333
ipv6GatewayFlag = "ipv6-gateway"
3434
routedFlag = "routed"
35-
noIpv4Gateway = "no-ipv4-gateway"
36-
noIpv6Gateway = "no-ipv6-gateway"
35+
noIpv4GatewayFlag = "no-ipv4-gateway"
36+
noIpv6GatewayFlag = "no-ipv6-gateway"
3737
)
3838

3939
type inputModel struct {
@@ -144,8 +144,8 @@ func configureFlags(cmd *cobra.Command) {
144144
cmd.Flags().String(ipv6PrefixFlag, "", "The IPv6 prefix of the network (CIDR)")
145145
cmd.Flags().String(ipv6GatewayFlag, "", "The IPv6 gateway of a network. If not specified, the first IP of the network will be assigned as the gateway")
146146
cmd.Flags().Bool(routedFlag, false, "If set to true, the network is routed and therefore accessible from other networks")
147-
cmd.Flags().Bool(noIpv4Gateway, false, "If set to true, the network doesn't have an IPv4 gateway")
148-
cmd.Flags().Bool(noIpv6Gateway, false, "If set to true, the network doesn't have an IPv6 gateway")
147+
cmd.Flags().Bool(noIpv4GatewayFlag, false, "If set to true, the network doesn't have an IPv4 gateway")
148+
cmd.Flags().Bool(noIpv6GatewayFlag, false, "If set to true, the network doesn't have an IPv6 gateway")
149149

150150
cmd.MarkFlagsMutuallyExclusive(routedFlag, ipv4DnsNameServersFlag)
151151
cmd.MarkFlagsMutuallyExclusive(routedFlag, ipv6DnsNameServersFlag)
@@ -171,8 +171,8 @@ func parseInput(p *print.Printer, cmd *cobra.Command) (*inputModel, error) {
171171
IPv6Prefix: flags.FlagToStringPointer(p, cmd, ipv6PrefixFlag),
172172
IPv6Gateway: flags.FlagToStringPointer(p, cmd, ipv6GatewayFlag),
173173
Routed: flags.FlagToBoolValue(p, cmd, routedFlag),
174-
NoIPv4Gateway: flags.FlagToBoolValue(p, cmd, noIpv4Gateway),
175-
NoIPv6Gateway: flags.FlagToBoolValue(p, cmd, noIpv6Gateway),
174+
NoIPv4Gateway: flags.FlagToBoolValue(p, cmd, noIpv4GatewayFlag),
175+
NoIPv6Gateway: flags.FlagToBoolValue(p, cmd, noIpv6GatewayFlag),
176176
}
177177

178178
if p.IsVerbosityDebug() {

internal/cmd/beta/network/create/create_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ func TestParseInput(t *testing.T) {
189189
{
190190
description: "use ipv4 gateway nil",
191191
flagValues: fixtureFlagValues(func(flagValues map[string]string) {
192-
flagValues[noIpv4Gateway] = "true"
192+
flagValues[noIpv4GatewayFlag] = "true"
193193
delete(flagValues, ipv4GatewayFlag)
194194
}),
195195
isValid: true,
@@ -217,7 +217,7 @@ func TestParseInput(t *testing.T) {
217217
{
218218
description: "use ipv6 gateway nil",
219219
flagValues: fixtureFlagValues(func(flagValues map[string]string) {
220-
flagValues[noIpv6Gateway] = "true"
220+
flagValues[noIpv6GatewayFlag] = "true"
221221
delete(flagValues, ipv6GatewayFlag)
222222
}),
223223
isValid: true,

internal/cmd/beta/network/update/update.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ const (
2929
ipv4GatewayFlag = "ipv4-gateway"
3030
ipv6DnsNameServersFlag = "ipv6-dns-name-servers"
3131
ipv6GatewayFlag = "ipv6-gateway"
32-
noIpv4Gateway = "no-ipv4-gateway"
33-
noIpv6Gateway = "no-ipv6-gateway"
32+
noIpv4GatewayFlag = "no-ipv4-gateway"
33+
noIpv6GatewayFlag = "no-ipv6-gateway"
3434
)
3535

3636
type inputModel struct {
@@ -139,8 +139,8 @@ func configureFlags(cmd *cobra.Command) {
139139
cmd.Flags().String(ipv4GatewayFlag, "", "The IPv4 gateway of a network. If not specified, the first IP of the network will be assigned as the gateway")
140140
cmd.Flags().StringSlice(ipv6DnsNameServersFlag, nil, "List of DNS name servers for IPv6. Nameservers cannot be defined for routed networks")
141141
cmd.Flags().String(ipv6GatewayFlag, "", "The IPv6 gateway of a network. If not specified, the first IP of the network will be assigned as the gateway")
142-
cmd.Flags().Bool(noIpv4Gateway, false, "If set to true, the network doesn't have an IPv4 gateway")
143-
cmd.Flags().Bool(noIpv6Gateway, false, "If set to true, the network doesn't have an IPv6 gateway")
142+
cmd.Flags().Bool(noIpv4GatewayFlag, false, "If set to true, the network doesn't have an IPv4 gateway")
143+
cmd.Flags().Bool(noIpv6GatewayFlag, false, "If set to true, the network doesn't have an IPv6 gateway")
144144

145145
cmd.MarkFlagsMutuallyExclusive(routedFlag, ipv4DnsNameServersFlag)
146146
cmd.MarkFlagsMutuallyExclusive(routedFlag, ipv6DnsNameServersFlag)
@@ -163,8 +163,8 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu
163163
IPv4Gateway: flags.FlagToStringPointer(p, cmd, ipv4GatewayFlag),
164164
IPv6DnsNameServers: flags.FlagToStringSlicePointer(p, cmd, ipv6DnsNameServersFlag),
165165
IPv6Gateway: flags.FlagToStringPointer(p, cmd, ipv6GatewayFlag),
166-
NoIPv4Gateway: flags.FlagToBoolValue(p, cmd, noIpv4Gateway),
167-
NoIPv6Gateway: flags.FlagToBoolValue(p, cmd, noIpv6Gateway),
166+
NoIPv4Gateway: flags.FlagToBoolValue(p, cmd, noIpv4GatewayFlag),
167+
NoIPv6Gateway: flags.FlagToBoolValue(p, cmd, noIpv6GatewayFlag),
168168
}
169169

170170
if p.IsVerbosityDebug() {

internal/cmd/beta/network/update/update_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func TestParseInput(t *testing.T) {
186186
description: "use ipv4 gateway nil",
187187
argValues: fixtureArgValues(),
188188
flagValues: fixtureFlagValues(func(flagValues map[string]string) {
189-
flagValues[noIpv4Gateway] = "true"
189+
flagValues[noIpv4GatewayFlag] = "true"
190190
delete(flagValues, ipv4GatewayFlag)
191191
}),
192192
isValid: true,
@@ -212,7 +212,7 @@ func TestParseInput(t *testing.T) {
212212
description: "use ipv6 gateway nil",
213213
argValues: fixtureArgValues(),
214214
flagValues: fixtureFlagValues(func(flagValues map[string]string) {
215-
flagValues[noIpv6Gateway] = "true"
215+
flagValues[noIpv6GatewayFlag] = "true"
216216
delete(flagValues, ipv6GatewayFlag)
217217
}),
218218
isValid: true,

0 commit comments

Comments
 (0)