Skip to content

Commit

Permalink
nitpicks
Browse files Browse the repository at this point in the history
  • Loading branch information
majewsky committed Nov 22, 2024
1 parent 535575b commit ba83b38
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/cmd/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,5 @@ type liquidQuotaOperationFlags struct {

func (l *liquidQuotaOperationFlags) AddToCmd(cmd *cobra.Command) {
cmd.Flags().StringVarP(&l.endpoint, "endpoint", "e", "", "query a liquid running locally")
cmd.Flags().StringSliceVarP(&l.quotaValues, "quota_values", "q", nil, "quota values $RESURCE=$VALUE (comma separated list)")
cmd.Flags().StringSliceVarP(&l.quotaValues, "quota-values", "q", nil, "quota values $RESOURCE=$VALUE (comma-separated list)")
}
4 changes: 2 additions & 2 deletions internal/cmd/liquid.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,15 +384,15 @@ func (c *liquidSetQuotaCmd) Run(cmd *cobra.Command, args []string) error {
endpoint := c.liquidQuotaOperationFlags.endpoint

if len(c.liquidQuotaOperationFlags.quotaValues) == 0 {
return errors.New("flag --quota_values is required")
return errors.New("flag --quota-values is required")
}
var serviceQuotaRequest liquid.ServiceQuotaRequest
serviceQuotaRequest.Resources = make(map[liquid.ResourceName]liquid.ResourceQuotaRequest)
resourceQuotaStrings := c.liquidQuotaOperationFlags.quotaValues
for _, resourceQuotaString := range resourceQuotaStrings {
parts := strings.Split(resourceQuotaString, "=")
if len(parts) != 2 {
return errors.New("quota values should be formatted $RESOURCE1=$VALUE1,$RESOURCE2=$VALUE2")
return errors.New("quota values should be formatted like $RESOURCE1=$VALUE1,$RESOURCE2=$VALUE2")
}
quota, err := strconv.ParseUint(parts[1], 10, 64)
if err != nil {
Expand Down

0 comments on commit ba83b38

Please sign in to comment.