Setting a sitelink to the empty string removes it, so this was already possible, but not via the “-” syntax.
- Patch without arc
- git checkout -b D969 && curl -L https://phabricator.wikimedia.org/D969?download=true | git apply
Before discarding the value, we could, if it’s nonempty, first compare it with $i->getSitelink ( $command->site ) (cf. commandSetSitelink a bit further up), and reject the action if it doesn’t match. This would be a kind of “only remove this sitelink if it matches what I expect, otherwise leave it alone”. Do you think that would be useful?
Or, phrased differently: “-Q1234|xywiki|” would be “remove the xywiki sitelink”, whereas “-Q1234|xywiki|foobar” would be “remove exactly this sitelink, do nothing if it’s not there”.
I have checked in a manually edited version (got "error: patch failed: public_html/quickstatements.php:801; error: public_html/quickstatements.php: patch does not apply") to master.
Checking $i->getSitelink($command->site) might be useful, but I think we can do without that for now.