Let me take back something I just said. The query stuff did *not* work
properly in CLI mode. I just checked in some code to hopefully make it
do so, though. As always, let me know if you find bugs (esp. if you
figure out how to fix them).