| 47 | } |
| 48 | |
| 49 | func (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 | |
| 68 | func psCommand(p *ProjectOptions, dockerCli command.Cli, backendOptions *BackendOptions) *cobra.Command { |
| 69 | opts := psOptions{ |