Properly set the value of --query to the query buffer