MCPcopy Create free account
hub / github.com/cogentcore/core / parseFlags

Function parseFlags

cli/args.go:283–291  ·  view source on GitHub ↗

parseFlags parses the given flags using the given ordered map of all of the available flags, setting the values from that map accordingly. Setting errNotFound to true causes flags that are not in allFlags to trigger an error; otherwise, it just skips those. It is recommended that the [ErrNotFound] a

(flags map[string]string, allFlags *fields, errNotFound bool)

Source from the content-addressed store, hash-verified

281// gotten through [getArgs] first, and the map of available flags should
282// be gotten through [parseArgs] first.
283func parseFlags(flags map[string]string, allFlags *fields, errNotFound bool) error {
284 for name, value := range flags {
285 err := parseFlag(name, value, allFlags, errNotFound)
286 if err != nil {
287 return err
288 }
289 }
290 return nil
291}
292
293// parseFlag parses the flag with the given name and the given value
294// using the given map of all of the available flags, setting the value

Callers 1

SetFromArgsFunction · 0.85

Calls 1

parseFlagFunction · 0.85

Tested by

no test coverage detected