Support --query mode.