Just checked both a LEAP and openSUSE…the “zypper search-packages” command is not supported.
In any case from a description I found elsewhere, the command is only supposed to support searching disabled repos in addition to enabled which to me is only an incremental benefit since the repo would have to already be added to the system.
IMO the capability which would be big news is what was discussed years ago but never became reality, the ability to do a command line search that would be identical to what is now done at the “software.opensuse.org/search” website.
To me, this would not be too difficult to do, and would be implemented as follows…
The only decision that would need to be made is whether to implement the translation from zypper commands to the website functions on the client running zypper or on the server, either is possible and I’d expect wouldn’t matter much since since I’d expect there isn’t a determining factor like load, latency, complexity or security to be significant.
In the following architecture, the actual search is still done on the webserver, and the result is returned to the client.
I’d recommend JSON but can be any XML based message that carries the query from client to server and returns the result.
On the Server, create an API that exposes the specific functionality you want to support.
I’d expect that REST would be the web services implementation which would support the necessary requirements, there is no need to implement SOAP which is unnecessarily complex.
On the client side, create a zypper extension that supports the REST connection to the server, it should also contain a translation configuration supporting command options you want to support.
Someone could almost do this entirely on their own, but I don’t think the “software search” website code is published publicly (I could be wrong).
Zypper is published on github, so is available.
This would be a nice little project for someone ambitious, IMO would be gladly be accepted and make you famous forever!
An alternative approach to the above would require almost no technical knowledge but would be a lot more bloated…
Simply scrape the website page where you enter the package name to be searched, create a zypper command that injects the package name, and then figure out how you want to display the result.
In both of the above, I’m guessing that the package results page is built from a database query result that might be almost exactly what you need to build a command line result and more useful than the webpage so might be easier for a website maintainer or designer to help.