basex -c"SET STRIPWS false" query.xq ...
…but this will fail as the comparable BaseX 9 option was called CHOP.
You could use XQuery to retrieve the version number…
data(db:system()//version)
…or to check if a specific option is supported:
try { prof:void(db:option('chop')), '!' } catch * { '?' }
In general, I would recommend updating to the latest version whenever possible…
Hope this helps,
Christian