diff --git a/port_set.go b/port_set.go index 7f40811..c7c7c7a 100644 --- a/port_set.go +++ b/port_set.go @@ -31,10 +31,10 @@ type PortSettingCommand struct { Address string `required:"" help:"the Netgear switch's IP address or host name to connect to" short:"a"` Ports []int `required:"" help:"port number (starting with 1), use multiple times for setting multiple ports at once" short:"p" name:"port"` Name string `optional:"" help:"sets the name of a port, 1-16 character limit" short:"n"` - Speed string `optional:"" help:"set the speed and duplex of the port" short:"s"` - IngressRateLimit string `optional:"" help:"set an incoming rate limit for the port" short:"i"` - EgressRateLimit string `optional:"" help:"set an outgoing rate limit for the port" short:"o"` - FlowControl string `optional:"" help:"enable/disable flow control on port"` + Speed string `optional:"" help:"set the speed and duplex of the port ['100M full', '100M half', '10M full', '10M half', 'Auto', 'Disable']" short:"s"` + IngressRateLimit string `optional:"" help:"set an incoming rate limit for the port ['1 Mbit/s', '128 Mbit/s', '16 Mbit/s', '2 Mbit/s', '256 Mbit/s', '32 Mbit/s', '4 Mbit/s', '512 Kbit/s', '512 Mbit/s', '64 Mbit/s', '8 Mbit/s', 'No Limit']" short:"i"` + EgressRateLimit string `optional:"" help:"set an outgoing rate limit for the port ['1 Mbit/s', '128 Mbit/s', '16 Mbit/s', '2 Mbit/s', '256 Mbit/s', '32 Mbit/s', '4 Mbit/s', '512 Kbit/s', '512 Mbit/s', '64 Mbit/s', '8 Mbit/s', 'No Limit']" short:"o"` + FlowControl string `optional:"" help:"enable/disable flow control on port ['Off', 'On']"` } func (portSet *PortSettingCommand) Run(args *GlobalOptions) error { @@ -138,19 +138,19 @@ func comparePortSettings(name Setting, defaultValue string, newValue string) (st case Speed: speed := bidiMapLookup(newValue, portSpeedMap) if speed == "unknown" { - return speed, errors.New("port speed could not be set. Accepted vaules are: " + valuesAsString(portSpeedMap)) + return speed, errors.New("port speed could not be set. Accepted values are: " + valuesAsString(portSpeedMap)) } return speed, nil case IngressRateLimit: inRateLimit := bidiMapLookup(newValue, portRateLimitMap) if inRateLimit == "unknown" { - return inRateLimit, errors.New("ingress rate limit could not be set. Accepted vaules are: " + valuesAsString(portRateLimitMap)) + return inRateLimit, errors.New("ingress rate limit could not be set. Accepted values are: " + valuesAsString(portRateLimitMap)) } return inRateLimit, nil case EgressRateLimit: outRateLimit := bidiMapLookup(newValue, portRateLimitMap) if outRateLimit == "unknown" { - return outRateLimit, errors.New("ingress rate limit could not be set. Accepted vaules are: " + valuesAsString(portRateLimitMap)) + return outRateLimit, errors.New("ingress rate limit could not be set. Accepted values are: " + valuesAsString(portRateLimitMap)) } return outRateLimit, nil case FlowControl: diff --git a/port_set_test.go b/port_set_test.go index ae3af29..72d313b 100644 --- a/port_set_test.go +++ b/port_set_test.go @@ -2,10 +2,11 @@ package main import ( _ "embed" - "github.com/corbym/gocrest/is" - "github.com/corbym/gocrest/then" "strings" "testing" + + "github.com/corbym/gocrest/is" + "github.com/corbym/gocrest/then" ) func TestFindHashInPortHtml(t *testing.T) {