Open aqw opened 2 months ago
Hm.
It's not that the flag can't be used multiple times. It can. You can have multiple match criteria and specify them by either multiple expressions after --match
or distribute them across multiple --match
options and I think that's fine. They should normally be treated as AND
ed. The bug appears to be that multiple match criteria for the same key overwrite eachother instead of being combined by AND.
IOW: In my view the result of your query should not necessarily be an error but no result instead, as there is no asset that matches both criteria. And in the general case (regex) we can't easily tell that the given criteria are contradictory, which is why I'm not sold on the error. When exactly would we raise it?
So, agree it's a bug, but not so much on the solution.
Now that I've used --match
more, the behavior you described is definitely the right behavior.
+1
I ran an
onyo get
command similar to the following:The result was that
--match type=laptop
was silently ignored and only--match type=desktop
was used.I expected that
onyo get
would error, and tell me that--match
can only be used once.This may affect other option flags as well.