MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / parseMaxBytesOption

Function parseMaxBytesOption

app/cli/cmd/casbackend.go:138–152  ·  view source on GitHub ↗

parseMaxBytesOption validates and parses the --max-bytes flag value. It stores the parsed result in parsedMaxBytes for child commands to use.

()

Source from the content-addressed store, hash-verified

136// parseMaxBytesOption validates and parses the --max-bytes flag value.
137// It stores the parsed result in parsedMaxBytes for child commands to use.
138func parseMaxBytesOption() error {
139 parsedMaxBytes = nil
140 if maxBytesCASBackendOption == "" {
141 return nil
142 }
143
144 bytes, err := bytefmt.ToBytes(maxBytesCASBackendOption)
145 if err != nil {
146 return fmt.Errorf("invalid max-bytes format: %w", err)
147 }
148
149 bytesInt := int64(bytes)
150 parsedMaxBytes = &bytesInt
151 return nil
152}
153
154// captureUpdateFlags reads the --default, --fallback, and --description flags only when explicitly set and
155// stores their values in the package-level pointer options. This avoids treating their zero

Calls

no outgoing calls

Tested by

no test coverage detected