MCPcopy
hub / github.com/docker/compose / parseFilter

Method parseFilter

cmd/compose/ps.go:49–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47}
48
49func (p *psOptions) parseFilter() error {
50 if p.Filter == "" {
51 return nil
52 }
53 key, val, ok := strings.Cut(p.Filter, "=")
54 if !ok {
55 return errors.New("arguments to --filter should be in form KEY=VAL")
56 }
57 switch key {
58 case "status":
59 p.Status = append(p.Status, val)
60 return nil
61 case "source":
62 return api.ErrNotImplemented
63 default:
64 return fmt.Errorf("unknown filter %s", key)
65 }
66}
67
68func psCommand(p *ProjectOptions, dockerCli command.Cli, backendOptions *BackendOptions) *cobra.Command {
69 opts := psOptions{

Callers 1

psCommandFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected